From: Rich Salz Date: Wed, 14 Jun 2017 17:54:04 +0000 (-0400) Subject: Undo commit 40720ce X-Git-Tag: OpenSSL_1_1_1-pre1~1107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0791bef0d42ddc9a2c2851f279f4a2db39153b6e;p=openssl Undo commit 40720ce Comment in the commit: /* Ignore NULLs, thanks to Bob Beck */ Reviewed-by: Richard Levitte Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/3700) --- diff --git a/crypto/err/err.c b/crypto/err/err.c index adbd41e144..906e3543e1 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -757,20 +757,17 @@ void ERR_add_error_vdata(int num, va_list args) n = 0; for (i = 0; i < num; i++) { a = va_arg(args, char *); - /* ignore NULLs, thanks to Bob Beck */ - if (a != NULL) { - n += strlen(a); - if (n > s) { - s = n + 20; - p = OPENSSL_realloc(str, s + 1); - if (p == NULL) { - OPENSSL_free(str); - return; - } - str = p; + n += strlen(a); + if (n > s) { + s = n + 20; + p = OPENSSL_realloc(str, s + 1); + if (p == NULL) { + OPENSSL_free(str); + return; } - OPENSSL_strlcat(str, a, (size_t)s + 1); + str = p; } + OPENSSL_strlcat(str, a, (size_t)s + 1); } ERR_set_error_data(str, ERR_TXT_MALLOCED | ERR_TXT_STRING); }