commit 73c37e06b137bc9440e703d2b7c7bafcf622ece8
parent dc802aa5eae2fc5821ee03915c501c8880c62677
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 5 Sep 2021 18:20:19 +0300
mhd_str: silent sanitizer false-positive error
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
@@ -821,7 +821,9 @@ MHD_str_remove_tokens_caseless_ (char *str,
}
/* s1 should point to the next token in the input string or beyond
* the end of the input string */
- if ((str + *str_len) < (s1 + tkn_len))
+ /* The next comparison is modified version of
+ * ((str + *str_len) < (s1 + tkn_len)) to silent analyzer error */
+ if (*str_len < ((size_t) (s1 - str) + tkn_len))
{ /* The rest of the 's1' is too small to match 'tkn' */
if ((str + *str_len) > s1)
{ /* Copy the rest of the string */