From 96a58c0917f3635ba7e69494512ff45a6231d463 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Sat, 12 Dec 2015 21:05:12 +0000 Subject: move initialization of buf up to quell warnings and make it obvious the err case is ok. ok bcook@ --- lib/libssl/src/crypto/asn1/tasn_dec.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3