diff --git a/src/x509.c b/src/x509.c index 2dfe1517e..10f9e2a6b 100644 --- a/src/x509.c +++ b/src/x509.c @@ -5795,7 +5795,11 @@ static int X509PrintExtensions(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent) ret = WOLFSSL_FAILURE; break; } - ret = wolfSSL_BIO_write(bio, scratch, scratchLen); + + if (wolfSSL_BIO_write(bio, scratch, scratchLen) <= 0) { + ret = WOLFSSL_FAILURE; + break; + } } } }