From b4000a83a9f63dffe9a50cb6a1ded52c310da626 Mon Sep 17 00:00:00 2001 From: miod <> Date: Mon, 29 Sep 2014 04:16:49 +0000 Subject: X509_VERIFY_PARAM_set1_name(): if invoked with NULL as the second parameter, correctly set param->name to NULL after having freed it. ok bcook@ --- src/lib/libcrypto/x509/x509_vpm.c | 3 ++- src/lib/libssl/src/crypto/x509/x509_vpm.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c index 4ad2350222..8ec972050d 100644 --- a/src/lib/libcrypto/x509/x509_vpm.c +++ b/src/lib/libcrypto/x509/x509_vpm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vpm.c,v 1.10 2014/07/22 02:21:20 beck Exp $ */ +/* $OpenBSD: x509_vpm.c,v 1.11 2014/09/29 04:16:49 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2004. */ @@ -213,6 +213,7 @@ int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name) { free(param->name); + param->name = NULL; if (name == NULL) return 1; param->name = strdup(name); diff --git a/src/lib/libssl/src/crypto/x509/x509_vpm.c b/src/lib/libssl/src/crypto/x509/x509_vpm.c index 4ad2350222..8ec972050d 100644 --- a/src/lib/libssl/src/crypto/x509/x509_vpm.c +++ b/src/lib/libssl/src/crypto/x509/x509_vpm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vpm.c,v 1.10 2014/07/22 02:21:20 beck Exp $ */ +/* $OpenBSD: x509_vpm.c,v 1.11 2014/09/29 04:16:49 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2004. */ @@ -213,6 +213,7 @@ int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name) { free(param->name); + param->name = NULL; if (name == NULL) return 1; param->name = strdup(name); -- cgit v1.2.3-55-g6feb