From c8377cb9ce170728f1232c5d9f54b890bc18373c Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 20 Dec 2018 02:14:16 +0300 Subject: [PATCH] Workaround 'nl-result_buf is out of bounds' cppcheck false positive * os_dep.c [NEED_CALLINFO && LINUX && !SMALL_CONFIG] (GC_print_callers): Replace nl-result_buf to (word)nl-COVERT_DATAFLOW(result_buf). --- os_dep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/os_dep.c b/os_dep.c index f71469c4..25d893ab 100644 --- a/os_dep.c +++ b/os_dep.c @@ -4789,8 +4789,10 @@ GC_INNER void GC_print_callers(struct callinfo info[NFRAMES]) *nl = ':'; } if (strncmp(result_buf, "main", - nl != NULL ? (size_t)(nl - result_buf) - : result_len) == 0) { + nl != NULL + ? (size_t)((word)nl /* a cppcheck workaround */ + - COVERT_DATAFLOW(result_buf)) + : result_len) == 0) { stop = TRUE; } } -- 2.50.1