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
This commit is contained in:
Daniel Stenberg 2016-04-26 23:55:31 +02:00
parent c2b3f264cb
commit ab691309ce
1 changed files with 2 additions and 1 deletions

View 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);
}