From 9ccb3a4520a22cfa635eed3057b440a9e76bfbdd Mon Sep 17 00:00:00 2001 From: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:19:44 +0200 Subject: [PATCH] Adjust text_sanitizer to accept the default value (#18870) Allow src to receive the specified empty value --- src/libnetdata/sanitizers/utf8-sanitizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnetdata/sanitizers/utf8-sanitizer.c b/src/libnetdata/sanitizers/utf8-sanitizer.c index 37e7ff9fe729c8..e10d88f41bdd0d 100644 --- a/src/libnetdata/sanitizers/utf8-sanitizer.c +++ b/src/libnetdata/sanitizers/utf8-sanitizer.c @@ -3,7 +3,7 @@ #include "../libnetdata.h" size_t text_sanitize(unsigned char *dst, const unsigned char *src, size_t dst_size, const unsigned char *char_map, bool utf, const char *empty, size_t *multibyte_length) { - if(unlikely(!src || !dst || !dst_size)) return 0; + if(unlikely(!dst || !dst_size)) return 0; // skip leading spaces and invalid characters while(src && *src && !IS_UTF8_BYTE(*src) && (isspace(*src) || iscntrl(*src) || !isprint(*src)))