projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e66f6c
)
wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocate...
author
Zichen Xie
<zichenxie0106@gmail.com>
Fri, 15 Nov 2024 06:38:36 +0000
(
00:38
-0600)
committer
Johannes Berg
<johannes.berg@intel.com>
Wed, 4 Dec 2024 15:11:11 +0000
(16:11 +0100)
kunit_kzalloc() may return NULL, dereferencing it without NULL check may
lead to NULL dereference.
Add a NULL check for ies.
Fixes:
45d43937a44c
("wifi: cfg80211: add a kunit test for 6 GHz colocated AP parsing")
Signed-off-by: Zichen Xie <zichenxie0106@gmail.com>
Link:
https://patch.msgid.link/20241115063835.5888-1-zichenxie0106@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/tests/scan.c
patch
|
blob
|
blame
|
history
diff --git
a/net/wireless/tests/scan.c
b/net/wireless/tests/scan.c
index 9f458be71659518fb77d3c4feecbdc89cc6bacd0..79a99cf5e8922fea5ffac0222bbd565edc2d3969 100644
(file)
--- a/
net/wireless/tests/scan.c
+++ b/
net/wireless/tests/scan.c
@@
-810,6
+810,8
@@
static void test_cfg80211_parse_colocated_ap(struct kunit *test)
skb_put_data(input, "123", 3);
ies = kunit_kzalloc(test, struct_size(ies, data, input->len), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, ies);
+
ies->len = input->len;
memcpy(ies->data, input->data, input->len);