From: tedu Date: Thu, 24 Apr 2014 17:13:11 +0000 (+0000) Subject: obvious use after free was less obviously not a use after free. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ce54c9b2f7b2550c884a7b9b6fe1f315d405eff8;p=openbsd 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. --- 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;