diff options
author | 2023-12-20 15:52:56 +0000 | |
---|---|---|
committer | 2024-01-03 09:10:04 -0700 | |
commit | 7ece381aa72d430ee117958abb5bb23e21d72f1d (patch) | |
tree | b5abec86c9f20faa32dd3ccae6d29aa69512c454 /tools/perf/scripts/python/stackcollapse.py | |
parent | kunit: Add example of kunit_activate_static_stub() with pointer-to-function (diff) | |
download | wireguard-linux-7ece381aa72d430ee117958abb5bb23e21d72f1d.tar.xz wireguard-linux-7ece381aa72d430ee117958abb5bb23e21d72f1d.zip |
kunit: Protect string comparisons against NULL
Add NULL checks to KUNIT_BINARY_STR_ASSERTION() so that it will fail
cleanly if either pointer is NULL, instead of causing a NULL pointer
dereference in the strcmp().
A test failure could be that a string is unexpectedly NULL. This could
be trapped by KUNIT_ASSERT_NOT_NULL() but that would terminate the test
at that point. It's preferable that the KUNIT_EXPECT_STR*() macros can
handle NULL pointers as a failure.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions