From 89ec60912c649417ce2288be005bee0c66122803 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 6 Feb 2017 14:22:29 -0500 Subject: [PATCH] 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) --- crypto/bio/bio_cb.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.40.0