aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/flowgraph.h
diff options
authorRamsay Jones <ramsay@ramsayjones.plus.com>2021-09-28 00:43:31 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2022-05-20 10:54:33 +0200
commit4cd76bd9eeb3777219a307893e33d072df05eb37 (patch)
treea8e28b8b6455d036385dbfbe3ac60049d507b78c /flowgraph.h
parentc4706aa764f3ae68258ba60be6325a5662900362 (diff)
downloadsparse-dev-4cd76bd9eeb3777219a307893e33d072df05eb37.tar.gz
sparse: fix broken 'memcpy-max-count' check
commit a69f8d70 ("ptrlist: use ptr_list_nth() instead of linearize_ptr_\ list()", 2021-02-14) replaced a call to a local helper with a more generic ptr_list function. The local function, argument(), was used to retrieve the 'argno' argument to a function call, counting the arguments from one. This call was replaced by the generic ptr_list_nth() function, which accessed the ptr_list counting from zero. The 'argno' passed to the call to argument() was 3 (the byte count), which when passed to ptr_list_nth() was attempting to access the 4th (non-existent) argument. (The resulting null pointer was then passed to check_byte_count() function, which had an null-pointer check and so did not dereference the null pointer). This effectively disabled the memcpy-max-count check. In order to fix the check, change the 'argno' of 3 to the 'index' of 2. Also, add a simple regression test. Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'flowgraph.h')
0 files changed, 0 insertions, 0 deletions