From: Theodore Tso Date: Fri, 19 Feb 1993 00:26:30 +0000 (+0000) Subject: Sandia bug; return sane error message if passed in argument is NULL X-Git-Tag: krb5-1.0-beta3~341 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4fce6240eb7000bfc164c9ba49912e5990c7164d;p=krb5.git Sandia bug; return sane error message if passed in argument is NULL git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2488 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/kaddr2addr.c b/src/lib/krb5/asn.1/kaddr2addr.c index a9c67b52a..da565977c 100644 --- a/src/lib/krb5/asn.1/kaddr2addr.c +++ b/src/lib/krb5/asn.1/kaddr2addr.c @@ -54,6 +54,11 @@ register int *error; register krb5_address * const *temp; register int i; + if (!val) { + *error = EINVAL; + return 0; + } + /* count elements */ for (i = 0, temp = val; *temp; temp++,i++); @@ -89,7 +94,12 @@ register int *error; register struct type_KRB5_HostAddresses *retval = 0, *rv1 = 0, *rv2; register krb5_address * const *temp; register int i; - + + if (!val) { + *error = EINVAL; + return 0; + } + for (i = 0, temp = val; *temp; temp++,i++, rv1 = rv2) { rv2 = (struct type_KRB5_HostAddresses *) xmalloc(sizeof(*rv2));