commit b1a5840766481d9b1ce3836a176681367897cf1f
parent abe138ee3aaadea496fbdddd23d79fbe40113171
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 7 Jun 2022 21:28:01 +0300
test_str: added extra check to see why Coverity gives strange reports
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/test_str.c b/src/microhttpd/test_str.c
@@ -3661,6 +3661,14 @@ check_strx_from_uint32 (void)
" Locale: %s\n", t->val, (int) rs, buf, (int) b_size,
(intptr_t) rs, get_current_locale_str ());
}
+ else if (sizeof(buf) <= rs)
+ {
+ fprintf (stderr,
+ "ERROR: dstrs_w_values[%u] has string with too many"
+ "(%u) digits, size of 'buf' should be increased.\n",
+ (unsigned int) i, (unsigned int) rs);
+ return -1;
+ }
else if (0 != memcmp (buf + rs, erase + rs, sizeof(buf) - rs))
{
if (0 == c_failed[i])