From: Daniel Stenberg Date: Tue, 26 Apr 2016 21:55:31 +0000 (+0200) Subject: openssl: avoid BN_print a NULL bignum X-Git-Tag: curl-7_49_0~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab691309cee98d0cd5d7a44d8c8d514de6dfce66;p=thirdparty%2Fcurl.git openssl: avoid BN_print a NULL bignum OpenSSL 1.1.0-pre seems to return NULL(?) for a whole lot of those numbers so make sure the function handles this. Reported-by: Linus Nordberg --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index e9acf9a03f..2d18b1bc49 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2228,7 +2228,8 @@ static void pubkey_show(struct SessionHandle *data, snprintf(namebuf, sizeof(namebuf), "%s(%s)", type, name); - BN_print(mem, bn); + if(bn) + BN_print(mem, bn); push_certinfo(namebuf, num); }