From ce54c9b2f7b2550c884a7b9b6fe1f315d405eff8 Mon Sep 17 00:00:00 2001 From: tedu Date: Thu, 24 Apr 2014 17:13:11 +0000 Subject: [PATCH] obvious use after free was less obviously not a use after free. who uses '\0' as a null pointer constant? fix my mistake and restore original semantics. --- lib/libssl/src/ssl/kssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libssl/src/ssl/kssl.c b/lib/libssl/src/ssl/kssl.c index 9e71eed9fac..b04c83e17fe 100644 --- a/lib/libssl/src/ssl/kssl.c +++ b/lib/libssl/src/ssl/kssl.c @@ -963,7 +963,7 @@ kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text) free(*string); *string = NULL; - if ((*string = strdup(text ? text : "")) == NULL) + if (text && (*string = strdup(text)) == NULL) return KSSL_CTX_ERR; return KSSL_CTX_OK; -- 2.20.1