summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2015-12-12 21:05:12 +0000
committerBob Beck <beck@cvs.openbsd.org>2015-12-12 21:05:12 +0000
commit106447a35003c671687e8808c662b8c71852dc71 (patch)
treebe1d7846c4f6e145c940d7444e41e0ec58beb368 /lib
parentd0ffa878e64271005d8f68194b2754bf417680a1 (diff)
move initialization of buf up to quell warnings and make it obvious the err case is ok.
ok bcook@
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/asn1/tasn_dec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libcrypto/asn1/tasn_dec.c b/lib/libcrypto/asn1/tasn_dec.c
index dd350070f70..23a6740115e 100644
--- a/lib/libcrypto/asn1/tasn_dec.c
+++ b/lib/libcrypto/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