From 565611c2d15d304f7b03b163e03fec88c6b9a7cc Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 7 Mar 2022 20:27:13 +0000 Subject: core: Ensure radiotap parser errors are handled --- src/libwifi/core/frame/frame.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libwifi/core/frame/frame.c b/src/libwifi/core/frame/frame.c index 78fe069..408808d 100644 --- a/src/libwifi/core/frame/frame.c +++ b/src/libwifi/core/frame/frame.c @@ -42,7 +42,10 @@ int libwifi_get_wifi_frame(struct libwifi_frame *fi, const unsigned char *frame, if (radiotap) { struct libwifi_radiotap_info rtap_info = {0}; - libwifi_parse_radiotap_info(&rtap_info, frame_data, frame_len); + int ret = libwifi_parse_radiotap_info(&rtap_info, frame_data, frame_len); + if (ret != 0) { + return ret; + } // Skip forward by the length of the radiotap header frame_data_len -= rtap_info.length; -- cgit 1.4.1