]> granicus.if.org Git - curl/commitdiff
openssl: avoid BN_print a NULL bignum
authorDaniel Stenberg <daniel@haxx.se>
Tue, 26 Apr 2016 21:55:31 +0000 (23:55 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 26 Apr 2016 21:55:31 +0000 (23:55 +0200)
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
lib/vtls/openssl.c

index e9acf9a03f6b7f26cb070bff09ce39766acccadf..2d18b1bc493e23a32be58597d7275fb29f0166e9 100644 (file)
@@ -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);
 }