netdev: check for connected in FT frame event
James Prestwood
PATCH 1/2 netdev: check for connected in FT frame event
This frame could come unsolicited and cause a NULL dereference if IWD is not connected.
--- src/netdev.c | 3 +++ 1 file changed, 3 insertions(+)
src/netdev.c +3 -0
@@ -4525,6 +4525,9 @@ static void netdev_ft_response_frame_event(const struct mmpdu_header *hdr,size_t ies_len;struct ft_ds_finder finder; +if (!netdev->connected) +return ; + ret =ft_over_ds_parse_action_response (body, body_len, &spa, &aa, &ies, &ies_len);if (ret <0 )
Signature · 1 line
2.34.1
James Prestwood
PATCH 2/2 netdev: move ocvc setting to after connected check
We cannot check 'handshake' until first checking that IWD is connected.
--- src/netdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
src/netdev.c +4 -2
@@ -4990,8 +4990,7 @@ static void netdev_sa_query_req_frame_event(const struct mmpdu_header *hdr,uint16_t transaction;const uint8_t *oci;struct netdev *netdev = user_data; -bool ocvc = netdev->handshake->supplicant_ocvc && - netdev->handshake->authenticator_ocvc; +bool ocvc;if (body_len <4 ) {l_debug ("SA Query request too short" );
@@ -5001,6 +5000,9 @@ static void netdev_sa_query_req_frame_event(const struct mmpdu_header *hdr,if (!netdev->connected)return ; + ocvc = netdev->handshake->supplicant_ocvc && + netdev->handshake->authenticator_ocvc; +/* only care about SA Queries from our connected AP */ if (memcmp (hdr->address_2, netdev->handshake->aa,6 ))return ;
Signature · 1 line
2.34.1
Denis Kenzior
Hi James,
Quoted 6 lines · James Prestwood
This frame could come unsolicited and cause a NULL dereference if IWD is not connected.
--- src/netdev.c | 3 +++ 1 file changed, 3 insertions(+)
Both applied, thanks.
Regards,
-Denis