From d81a08a03b6f1644dec0837eef53ffe7c3d1bac0 Mon Sep 17 00:00:00 2001 From: Andras Fekete Date: Mon, 4 Mar 2024 09:48:31 -0500 Subject: [PATCH 1/2] Catch error return code and remove redundant condition --- src/x509.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/x509.c b/src/x509.c index 05c3a02d41..eefa69cb27 100644 --- a/src/x509.c +++ b/src/x509.c @@ -1545,22 +1545,10 @@ int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out, WOLFSSL_X509_EXTENSION *ext, WOLFSSL_MSG("Memory error"); return rc; } - if (sk->next) { - if ((valLen = XSNPRINTF(val, len, "%*s%s,", - indent, "", str->strData)) - >= len) { - XFREE(val, NULL, DYNAMIC_TYPE_TMP_BUFFER); - return rc; - } - } else { - if ((valLen = XSNPRINTF(val, len, "%*s%s", - indent, "", str->strData)) - >= len) { - XFREE(val, NULL, DYNAMIC_TYPE_TMP_BUFFER); - return rc; - } - } - if ((tmpLen + valLen) >= tmpSz) { + valLen = XSNPRINTF(val, len, "%*s%s", indent, "", + str->strData); + if ((valLen < 0) || (valLen >= len) + || ((tmpLen + valLen) >= tmpSz)) { XFREE(val, NULL, DYNAMIC_TYPE_TMP_BUFFER); return rc; } From 717a32808fcc009159b8fe2e5e2a8fc84efad006 Mon Sep 17 00:00:00 2001 From: Andras Fekete Date: Mon, 4 Mar 2024 10:24:32 -0500 Subject: [PATCH 2/2] Fix missing include --- IDE/MSVS-2019-AZSPHERE/shared/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/IDE/MSVS-2019-AZSPHERE/shared/util.h b/IDE/MSVS-2019-AZSPHERE/shared/util.h index 005676f4ff..fc54a709ae 100644 --- a/IDE/MSVS-2019-AZSPHERE/shared/util.h +++ b/IDE/MSVS-2019-AZSPHERE/shared/util.h @@ -26,6 +26,7 @@ #include #include #include +#include #define _GNU_SOURCE /* defines NI_NUMERICHOST */ #ifndef NI_MAXHOST