summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2015-12-12 21:05:11 +0000
committerbeck <beck@openbsd.org>2015-12-12 21:05:11 +0000
commitadd7fb59645aa22cd59affff3cf85f7a6c7ad726 (patch)
treed535c73d4a58fcaf3033bc3d7b4b869b188d3872 /lib/libssl/src
parentprevent possibly use of uninitialized variable (diff)
downloadwireguard-openbsd-add7fb59645aa22cd59affff3cf85f7a6c7ad726.tar.xz
wireguard-openbsd-add7fb59645aa22cd59affff3cf85f7a6c7ad726.zip
move initialization of buf up to quell warnings and make it obvious the err case is ok.
ok bcook@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/asn1/tasn_dec.c9
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