From: Dr. Stephen Henson Date: Thu, 27 Jul 2000 01:27:22 +0000 (+0000) Subject: Fix a bug in the new i2d_{ENUMERATED,INTEGER} that X-Git-Tag: OpenSSL-engine-0_9_6-beta1~17^2~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f6c1c9e95dd7ceadae070bd32e59cfa20726b42e;p=oweals%2Fopenssl.git Fix a bug in the new i2d_{ENUMERATED,INTEGER} that didn't recognise NULL to mean 'don't output anything' --- diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index 34b1a38c49..53b30f2b56 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -75,6 +75,7 @@ void ASN1_ENUMERATED_free(ASN1_ENUMERATED *x) int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp) { int len, ret; + if(!a) return 0; len = i2c_ASN1_INTEGER(a, NULL); ret=ASN1_object_size(0,len,V_ASN1_ENUMERATED); if(pp) { diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 45927ffd6e..bb8e9cf8f9 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -77,6 +77,7 @@ int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y) int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) { int len, ret; + if(!a) return 0; len = i2c_ASN1_INTEGER(a, NULL); ret=ASN1_object_size(0,len,V_ASN1_INTEGER); if(pp) {