You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which on line 1438, calls the callback argument like this:
ret=callback(opt->id, NULL);
where callback is acutest_cmdline_callback_). This callback then on line 1681 calls:
if (acutest_select_(arg) ==0)
where arg was NULL. This then (on line 1059) calls:
if (strcmp(acutest_list_[i].name, pattern) ==0)
Yet pattern, the parameter holding the value of arg, is a null pointer.
According to ISO C11, 7.1.4, "Use of library functions":
Each of the following statements applies unless explicitly stated otherwise in the detailed descriptions that follow: If an argument to a function has an invalid value (such as [...] a null pointer [...]) [...], the behavior is undefined.
The description of strcmp() in 7.24.4 does not state otherwise, so the behavior is undefined, and the above call to strcmp() invokes undefined behavior.
This was found when compiling the code with -fanalyzer with GCC 13.1.
The text was updated successfully, but these errors were encountered:
In
main()
, on line 1838, there is this call:which on line 1438, calls the
callback
argument like this:where
callback
isacutest_cmdline_callback_)
. This callback then on line 1681 calls:where
arg
wasNULL
. This then (on line 1059) calls:Yet
pattern
, the parameter holding the value ofarg
, is a null pointer.According to ISO C11, 7.1.4, "Use of library functions":
The description of
strcmp()
in 7.24.4 does not state otherwise, so the behavior is undefined, and the above call tostrcmp()
invokes undefined behavior.This was found when compiling the code with
-fanalyzer
with GCC 13.1.The text was updated successfully, but these errors were encountered: