diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2015-12-12 21:05:12 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2015-12-12 21:05:12 +0000 |
commit | 96a58c0917f3635ba7e69494512ff45a6231d463 (patch) | |
tree | fa9e9fc0716a76f0fbe9098e0e9e4792b89bd75d | |
parent | 648d6b7af3986d3d2daed1498488f2e8d628b1d3 (diff) |
move initialization of buf up to quell warnings and make it obvious the err case is ok.
ok bcook@
-rw-r--r-- | lib/libssl/src/crypto/asn1/tasn_dec.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libssl/src/crypto/asn1/tasn_dec.c b/lib/libssl/src/crypto/asn1/tasn_dec.c index dd350070f70..23a6740115e 100644 --- a/lib/libssl/src/crypto/asn1/tasn_dec.c +++ b/lib/libssl/src/crypto/asn1/tasn_dec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_dec.c,v 1.28 2015/12/04 04:19:25 beck Exp $ */ +/* $OpenBSD: tasn_dec.c,v 1.29 2015/12/12 21:05:11 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -676,6 +676,10 @@ asn1_d2i_ex_primitive(ASN1_VALUE **pval, const unsigned char **in, long inlen, const unsigned char *cont = NULL; long len; + buf.length = 0; + buf.max = 0; + buf.data = NULL; + if (!pval) { ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_NULL); return 0; /* Should never happen */ @@ -753,9 +757,6 @@ asn1_d2i_ex_primitive(ASN1_VALUE **pval, const unsigned char **in, long inlen, buf.data = NULL; } } else if (cst) { - buf.length = 0; - buf.max = 0; - buf.data = NULL; /* Should really check the internal tags are correct but * some things may get this wrong. The relevant specs * say that constructed string types should be OCTET STRINGs |