diff options
author | 2014-09-29 16:20:40 +0000 | |
---|---|---|
committer | 2014-09-29 16:20:40 +0000 | |
commit | 8f98f5d4bc988a9142894e6a24d553486d917d40 (patch) | |
tree | 3d8e069e518a08f9f08d6ef949be963e361fb101 /lib/libssl/src | |
parent | Move cipher configuration handling to the shared SSL configuration function (diff) | |
download | wireguard-openbsd-8f98f5d4bc988a9142894e6a24d553486d917d40.tar.xz wireguard-openbsd-8f98f5d4bc988a9142894e6a24d553486d917d40.zip |
Previous fix (1.12) would cause a NULL pointer dereference in the error path
if a NULL stack was passed as argument. Fix this by returning NULL early in
that case.
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/crypto/x509/x509_att.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libssl/src/crypto/x509/x509_att.c b/lib/libssl/src/crypto/x509/x509_att.c index e3acc18ed14..5e5cf4e3843 100644 --- a/lib/libssl/src/crypto/x509/x509_att.c +++ b/lib/libssl/src/crypto/x509/x509_att.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_att.c,v 1.12 2014/09/26 19:30:38 miod Exp $ */ +/* $OpenBSD: x509_att.c,v 1.13 2014/09/29 16:20:40 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -73,8 +73,7 @@ X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) } int -X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, - int lastpos) +X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) { ASN1_OBJECT *obj; @@ -133,7 +132,7 @@ X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr) if (x == NULL) { X509err(X509_F_X509AT_ADD1_ATTR, ERR_R_PASSED_NULL_PARAMETER); - goto err2; + return (NULL); } if (*x == NULL) { |