diff --git a/common/log.c b/common/log.c index 50a44e9e..4a0bd2f3 100644 --- a/common/log.c +++ b/common/log.c @@ -569,6 +569,7 @@ log_message(const enum logLevels lvl, const char *msg, ...) if (len > LOG_BUFFER_SIZE) { log_message(LOG_LEVEL_WARNING, "next message will be truncated"); + len = LOG_BUFFER_SIZE; } /* forcing the end of message string */ diff --git a/common/os_calls.c b/common/os_calls.c index 88b96e61..463af84c 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -2896,6 +2896,12 @@ g_strtrim(char *str, int trim_flags) text = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); text1 = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); + if (text == NULL || text1 == NULL) + { + free(text); + free(text1); + return 1; + } text1_index = 0; mbstowcs(text, str, len + 1); diff --git a/common/pixman-region.c b/common/pixman-region.c index eb3fd179..f974eb28 100644 --- a/common/pixman-region.c +++ b/common/pixman-region.c @@ -83,6 +83,12 @@ #define GOOD_RECT(rect) ((rect)->x1 < (rect)->x2 && (rect)->y1 < (rect)->y2) #define BAD_RECT(rect) ((rect)->x1 > (rect)->x2 || (rect)->y1 > (rect)->y2) +/* This file is included by pixman-region16.c which defines PREFIX(x). + * This check allows cppcheck 2.x to scan this file separately */ +#ifndef PREFIX +#define PREFIX(x) pixman_region##x +#endif + #ifdef XRDP_DEBUG #define GOOD(reg) \