summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2015-12-14 03:39:15 +0000
committerBob Beck <beck@cvs.openbsd.org>2015-12-14 03:39:15 +0000
commit1f4fd2fb60ff4660b4c7d9bd6986adacd1fe2b30 (patch)
tree2ad46e254fd90f2d03a8c9021f24e68ae979734c
parentb5b1ff3594a5fbaa835596e1caf311c981aa2df2 (diff)
initialize ext_len to 0.
ok guenther@
-rw-r--r--lib/libssl/src/crypto/x509v3/v3_conf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/x509v3/v3_conf.c b/lib/libssl/src/crypto/x509v3/v3_conf.c
index 37834813c78..20e156ce876 100644
--- a/lib/libssl/src/crypto/x509v3/v3_conf.c
+++ b/lib/libssl/src/crypto/x509v3/v3_conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v3_conf.c,v 1.18 2015/09/30 18:41:06 jsing Exp $ */
+/* $OpenBSD: v3_conf.c,v 1.19 2015/12/14 03:39:14 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -278,7 +278,7 @@ v3_generic_extension(const char *ext, char *value, int crit, int gen_type,
X509V3_CTX *ctx)
{
unsigned char *ext_der = NULL;
- long ext_len;
+ long ext_len = 0;
ASN1_OBJECT *obj = NULL;
ASN1_OCTET_STRING *oct = NULL;
X509_EXTENSION *extension = NULL;
@@ -294,6 +294,10 @@ v3_generic_extension(const char *ext, char *value, int crit, int gen_type,
ext_der = string_to_hex(value, &ext_len);
else if (gen_type == 2)
ext_der = generic_asn1(value, ctx, &ext_len);
+ else {
+ ERR_asprintf_error_data("Unexpected generic extension type %d", gen_type);
+ goto err;
+ }
if (ext_der == NULL) {
X509V3err(X509V3_F_V3_GENERIC_EXTENSION,