diff options
Diffstat (limited to 'crypto/heimdal/lib/asn1/asn1_print.c')
-rw-r--r-- | crypto/heimdal/lib/asn1/asn1_print.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/heimdal/lib/asn1/asn1_print.c b/crypto/heimdal/lib/asn1/asn1_print.c index 92e6419..e66ac22 100644 --- a/crypto/heimdal/lib/asn1/asn1_print.c +++ b/crypto/heimdal/lib/asn1/asn1_print.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -37,7 +37,7 @@ #include <getarg.h> #include <err.h> -RCSID("$Id: asn1_print.c,v 1.5 1999/12/02 17:05:01 joda Exp $"); +RCSID("$Id: asn1_print.c,v 1.6 2000/12/29 03:34:16 assar Exp $"); static struct et_list *et_list; @@ -99,6 +99,9 @@ loop (unsigned char *buf, size_t len, int indent) ret = der_get_tag (buf, len, &class, &type, &tag, &sz); if (ret) errx (1, "der_get_tag: %s", com_right (et_list, ret)); + if (sz > len) + errx (1, "unreasonable length (%u) > %u", + (unsigned)sz, (unsigned)len); buf += sz; len -= sz; for (i = 0; i < indent; ++i) |