From 1d9f81ab8641c5fb1f46d16081c8b320998c70ec Mon Sep 17 00:00:00 2001 From: Marc Date: Sun, 9 Jan 2022 16:00:19 +0000 Subject: core: Fix tag_iterator failure on empty tags. This code used to be `< 0`, but was changed to `<= 0` in commit d40ddfe. Thinking more about this, it's a bad idea to abort on 0 length tags, since it's completely valid for some tags (such as SSID) to be empty. It doesn't make sense to check if `tag_len` is below 0, because it's unsigned. So, remove the check completely. --- src/libwifi/core/frame/tag_iterator.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/libwifi/core/frame/tag_iterator.c b/src/libwifi/core/frame/tag_iterator.c index 662c2a2..0982c95 100644 --- a/src/libwifi/core/frame/tag_iterator.c +++ b/src/libwifi/core/frame/tag_iterator.c @@ -16,14 +16,10 @@ #include "tag_iterator.h" #include -#include #include int libwifi_tag_iterator_init(struct libwifi_tag_iterator *it, const void *tags_start, size_t data_len) { it->tag_header = (struct libwifi_tag_header *) tags_start; - if (it->tag_header->tag_len <= 0) { - return -EINVAL; - } it->tag_data = (unsigned char *) tags_start + sizeof(struct libwifi_tag_header); it->_next_tag_header = (struct libwifi_tag_header *) (it->tag_data + it->tag_header->tag_len); -- cgit 1.4.1