Skip to content

Commit

Permalink
Merge pull request #7300 from bandi13/codeSonarFixes
Browse files Browse the repository at this point in the history
Code sonar fixes
  • Loading branch information
SparkiDev authored Mar 7, 2024
2 parents b7c36fa + 717a328 commit f011012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
1 change: 1 addition & 0 deletions IDE/MSVS-2019-AZSPHERE/shared/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <wolfssl/ssl.h>
#include <ifaddrs.h>
#include <applibs/log.h>
#include <netdb.h>

#define _GNU_SOURCE /* defines NI_NUMERICHOST */
#ifndef NI_MAXHOST
Expand Down
20 changes: 4 additions & 16 deletions src/x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f011012

Please sign in to comment.