From 7428e0e2d78dcef7433f6b55ad04b28956a4d875 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 2 Aug 1994 13:15:21 +0000 Subject: [PATCH] * asn1_decode_k.c (asn1_decode_sequence_of_enctype): more fixing of realloc(NULL) returning NULL git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4032 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/ChangeLog | 5 +++++ src/lib/krb5/asn.1/asn1_decode_k.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index 1924b9051..6e1a33e94 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 2 07:22:57 1994 Tom Yu (tlyu@dragons-lair) + + * asn1_decode_k.c (asn1_decode_sequence_of_enctype): more fixing + of realloc(NULL) returning NULL + Sat Jul 23 08:48:18 1994 Tom Yu (tlyu@dragons-lair) * asn1buf.h: include ext-proto.h now to avoid type warnings diff --git a/src/lib/krb5/asn.1/asn1_decode_k.c b/src/lib/krb5/asn.1/asn1_decode_k.c index c74a14ccd..6a96e9764 100644 --- a/src/lib/krb5/asn.1/asn1_decode_k.c +++ b/src/lib/krb5/asn.1/asn1_decode_k.c @@ -669,7 +669,10 @@ asn1_error_code asn1_decode_sequence_of_enctype(DECLARG(asn1buf *, buf), { sequence_of(buf); while(asn1buf_remains(&seqbuf) > 0){ size++; - *val = (krb5_enctype*)realloc(*val,size*sizeof(krb5_enctype)); + if (*val == NULL) + *val = (krb5_enctype*)malloc(*val,size*sizeof(krb5_enctype)); + else + *val = (krb5_enctype*)realloc(*val,size*sizeof(krb5_enctype)); if(*val == NULL) return ENOMEM; retval = asn1_decode_enctype(&seqbuf,&((*val)[size-1])); if(retval) return retval; -- 2.26.2