unicode-utils: Add a null check to UTF-8 validation

Fixes #18563.
This commit is contained in:
João Valverde 2022-10-30 08:24:53 +00:00
parent 4851b4ceb5
commit 9504b54bc1
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ extern "C" {
#define _CHECK_UTF_8(level, str, len) \
do { \
const char *__uni_endptr; \
if (DEBUG_UTF_8_ENABLED && \
if (DEBUG_UTF_8_ENABLED && (str) != NULL && \
!g_utf8_validate(str, len, &__uni_endptr)) { \
ws_log_utf8(str, len, __uni_endptr); \
} \