From 4fce6240eb7000bfc164c9ba49912e5990c7164d Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 19 Feb 1993 00:26:30 +0000 Subject: [PATCH] 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 --- src/lib/krb5/asn.1/kaddr2addr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)); -- 2.26.2