diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2019-11-18 07:49:23 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2019-11-18 07:49:23 +0000 |
commit | ae1be78c7ee2afac5be63d2aa6686d123d750692 (patch) | |
tree | 49afb072f396f57962cef2ff1d045b0e2b9e410f | |
parent | 7a17a1f9b07ee1df3a0f8f08850c207a3cdc3479 (diff) | |
download | bcnm-ae1be78c7ee2afac5be63d2aa6686d123d750692.tar.gz bcnm-ae1be78c7ee2afac5be63d2aa6686d123d750692.tar.xz bcnm-ae1be78c7ee2afac5be63d2aa6686d123d750692.zip |
Specialcase SSIDs of length 0
-rw-r--r-- | src/libwpactrl/wpactrl_scan_parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libwpactrl/wpactrl_scan_parse.c b/src/libwpactrl/wpactrl_scan_parse.c index decb1cb..c97c59d 100644 --- a/src/libwpactrl/wpactrl_scan_parse.c +++ b/src/libwpactrl/wpactrl_scan_parse.c @@ -33,8 +33,8 @@ static int wpactrl_scan_parse_one (char const *s, size_t len, wpactrl_scanres_t s += pos + 1 ; len -= pos + 1 ; sr.flags_len = sa->len - sr.flags_start ; sr.ssid_start = sa->len ; - sr.ssid_len = len - 1 ; - if (!stralloc_catb(sa, s, len - 1) || !stralloc_0(sa)) return 0 ; + sr.ssid_len = len ? len - 1 : 0 ; + if (!stralloc_catb(sa, s, len ? len - 1 : 0) || !stralloc_0(sa)) return 0 ; *thing = sr ; return 1 ; |