From: Rich Salz Date: Mon, 6 Feb 2017 19:22:29 +0000 (-0500) Subject: If BIO_snprintf failed, keep trying. X-Git-Tag: OpenSSL_1_0_2l~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89ec60912c649417ce2288be005bee0c66122803;p=openssl If BIO_snprintf failed, keep trying. Thanks to Graeme Perrow for reporting and providing a possible fix. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/2565) --- diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c index d3e860686c..f96294bb43 100644 --- a/crypto/bio/bio_cb.c +++ b/crypto/bio/bio_cb.c @@ -78,6 +78,9 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp, len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio); + /* Ignore errors and continue printing the other information. */ + if (len < 0) + len = 0; p = buf + len; p_maxlen = sizeof(buf) - len;