From f810ee9c691754c377505dd1bb0f62009d6b4151 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 18 Mar 2013 14:19:40 +0000 Subject: [PATCH 15/17] Encode INTEGER correctly. If an ASN1_INTEGER structure is allocated but not explicitly set encode it as zero: don't generate an invalid zero length INTEGER. (cherry picked from commit 1643edc63c3e15b6db5a15a728bc288f2cc2bbc7) --- crypto/asn1/a_int.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index ad0d250..297c45a 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -116,7 +116,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) int pad=0,ret,i,neg; unsigned char *p,*n,pb=0; - if ((a == NULL) || (a->data == NULL)) return(0); + if (a == NULL) return(0); neg=a->type & V_ASN1_NEG; if (a->length == 0) ret=1; -- 1.7.9.5