mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-29 23:42:13 +01:00
fixes for defects identified by cppcheck and clang-tidy on --enable-debug builds: null deref in tests/api.c:load_pem_key_file_as_der(), redundant declarations in wolfcrypt/benchmark/benchmark.c, and numerous unchecked XSNPRINTF()s in wolfcrypt/src/logging.c and src/internal.c.
This commit is contained in:
@@ -20653,7 +20653,11 @@ static void LogAlert(int type)
|
||||
typeStr = AlertTypeToString(type);
|
||||
if (typeStr != NULL) {
|
||||
char buff[60];
|
||||
XSNPRINTF(buff, sizeof(buff), "Alert type: %s", typeStr);
|
||||
if (XSNPRINTF(buff, sizeof(buff), "Alert type: %s", typeStr)
|
||||
>= (int)sizeof(buff))
|
||||
{
|
||||
buff[sizeof(buff) - 1] = 0;
|
||||
}
|
||||
WOLFSSL_MSG(buff);
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user