eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 795f57e816b9dda7d059690fc9e9f74b21c169e9
parent 71a7190ed2ca6c028241daa430e1c965fdd57120
Author: James Prestwood <prestwoj@gmail.com>
Date:   Fri,  1 Mar 2024 11:40:53 -0800

p2p: check connected peer before processing request

Caught by static analysis, the dev->conn_peer pointer was being
dereferenced very early on without a NULL check, but further it
was being NULL checked. If there is a possibility of it being NULL
the check should be done much earlier.

Diffstat:
Msrc/p2p.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/p2p.c b/src/p2p.c @@ -2310,6 +2310,9 @@ static void p2p_device_go_negotiation_req_cb(const struct mmpdu_header *mpdu, if (!peer) return; + if (!dev->conn_peer) + return; + if (body_len < 8) return; @@ -2438,7 +2441,7 @@ static void p2p_device_go_negotiation_req_cb(const struct mmpdu_header *mpdu, memcpy(dev->conn_peer_interface_addr, req_info.intended_interface_addr, 6); - if (dev->is_go && dev->conn_peer) { + if (dev->is_go) { p2p_set_group_id(dev); dev->conn_config_delay =