From 4bb907522b35bf005691f32792c1a03714cf3871 Mon Sep 17 00:00:00 2001 From: Kareem Date: Fri, 21 Jul 2023 11:08:15 -0700 Subject: [PATCH] Fix wolfSSL_SMIME_write_PKCS7 not removing NULL characters between sections. --- src/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index 8b655b7d8..a85f4d977 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -36134,7 +36134,7 @@ static int wolfSSL_BIO_to_MIME_crlf(WOLFSSL_BIO* in, WOLFSSL_BIO* out) } /* remove trailing null */ - if (canonLine[canonLineLen] == '\0') { + if (canonLineLen >= 1 && canonLine[canonLineLen-1] == '\0') { canonLineLen--; }