Skip to content

Commit

Permalink
net: ieee802154: Fix possible null pointer de-reference
Browse files Browse the repository at this point in the history
ieee802154_scan() checks if ctx->scan_ctx (scan) is NULL what implies
that this can be true, but de-reference this variable before this
check what may cause a problem.

Fixes zephyrproject-rtos#23299 [3]

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information
Flavio Ceolin authored and hakehuang committed Mar 18, 2020
1 parent 11f4d78 commit 31f5250
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subsys/net/l2/ieee802154/ieee802154_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ static int ieee802154_scan(u32_t mgmt_request, struct net_if *iface,
return -EALREADY;
}

if (scan == NULL) {
return -EINVAL;
}

if (mgmt_request == NET_REQUEST_IEEE802154_ACTIVE_SCAN) {
struct ieee802154_frame_params params;

Expand Down

0 comments on commit 31f5250

Please sign in to comment.