about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMarc <foxtrot@malloc.me>2022-03-07 20:27:13 +0000
committerMarc <foxtrot@malloc.me>2022-03-07 20:27:13 +0000
commit565611c2d15d304f7b03b163e03fec88c6b9a7cc (patch)
tree25d7d239a5462c5026949cd9eba45f8d37ef18f9 /src
parent845c00da1a439ad7b92d5fb3bba49731e1f26e8d (diff)
downloadlibwifi-565611c2d15d304f7b03b163e03fec88c6b9a7cc.tar.gz
libwifi-565611c2d15d304f7b03b163e03fec88c6b9a7cc.tar.bz2
libwifi-565611c2d15d304f7b03b163e03fec88c6b9a7cc.zip
core: Ensure radiotap parser errors are handled
Diffstat (limited to 'src')
-rw-r--r--src/libwifi/core/frame/frame.c5
1 files changed, 4 insertions, 1 deletions
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,
42 42
43 if (radiotap) { 43 if (radiotap) {
44 struct libwifi_radiotap_info rtap_info = {0}; 44 struct libwifi_radiotap_info rtap_info = {0};
45 libwifi_parse_radiotap_info(&rtap_info, frame_data, frame_len); 45 int ret = libwifi_parse_radiotap_info(&rtap_info, frame_data, frame_len);
46 if (ret != 0) {
47 return ret;
48 }
46 49
47 // Skip forward by the length of the radiotap header 50 // Skip forward by the length of the radiotap header
48 frame_data_len -= rtap_info.length; 51 frame_data_len -= rtap_info.length;