From 5bd8288b370a00440e11932781abe28dd47b65db Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 29 Jun 2022 18:03:24 -0500 Subject: [PATCH] fix printed-null bug in wolfssl_print_number(). --- src/pk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk.c b/src/pk.c index 2bcb9e809..d7702dd33 100644 --- a/src/pk.c +++ b/src/pk.c @@ -267,8 +267,8 @@ static int wolfssl_print_number(WOLFSSL_BIO* bio, mp_int* num, const char* name, for (i = 0; (ret == 1) && (i < rawLen); i++) { /* Check for a complete line. */ if (li >= PRINT_NUM_MAX_DIGIT_LINE) { - /* More bytes coming so append carriage return. */ - line[li++] = '\n'; + /* More bytes coming so change the trailing ':' to a line break. */ + line[li-1] = '\n'; /* Write out the line. */ if (wolfSSL_BIO_write(bio, line, li) <= 0) { ret = 0;