obvious use after free was less obviously not a use after free.
authortedu <tedu@openbsd.org>
Thu, 24 Apr 2014 17:13:11 +0000 (17:13 +0000)
committertedu <tedu@openbsd.org>
Thu, 24 Apr 2014 17:13:11 +0000 (17:13 +0000)
who uses '\0' as a null pointer constant? fix my mistake and restore
original semantics.

lib/libssl/src/ssl/kssl.c

index 9e71eed..b04c83e 100644 (file)
@@ -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;