From d9ab0c4bcbad725de23bc45312884b856a3a6681 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Tue, 29 Oct 2019 12:08:47 +0100 Subject: [PATCH] Check bounds --- src/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index f487741bc..f4984536b 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -39554,7 +39554,7 @@ int wolfSSL_X509_NAME_print_ex(WOLFSSL_BIO* bio, WOLFSSL_X509_NAME* name, } totalSz += tmpSz; } - if (fullName[totalSz-1] == '\0') + if (totalSz > 0 && fullName[totalSz-1] == '\0') totalSz--; if (wolfSSL_BIO_write(bio, fullName, totalSz) != totalSz) return WOLFSSL_FAILURE;