about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-12-15 02:32:00 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-12-15 02:32:00 +0000
commit3c54eec70a6e3d422fbcb9c06cceab4b9b0f0ea5 (patch)
tree430810d3e65fe70ed99417f001ef6cf0b037930f
parent64c5e558ff00b1cb366e6b8500723c254164418a (diff)
downloadbcnm-3c54eec70a6e3d422fbcb9c06cceab4b9b0f0ea5.tar.gz
bcnm-3c54eec70a6e3d422fbcb9c06cceab4b9b0f0ea5.tar.xz
bcnm-3c54eec70a6e3d422fbcb9c06cceab4b9b0f0ea5.zip
Fix networks parsing
-rw-r--r--src/libwpactrl/wpactrl_networks_parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libwpactrl/wpactrl_networks_parse.c b/src/libwpactrl/wpactrl_networks_parse.c
index 444941a..1f7f0e9 100644
--- a/src/libwpactrl/wpactrl_networks_parse.c
+++ b/src/libwpactrl/wpactrl_networks_parse.c
@@ -22,13 +22,13 @@ static int wpactrl_networks_parse_one (char const *s, size_t len, wpactrl_networ
   pos = byte_rchr(s, len, '\t') ;
   if (!pos || pos >= len) goto eproto ;
   sr.flags_start = sa->len ;
-  if (wpactrl_flags_scan(s + pos + 1, sa) != pos) goto eproto ;
+  if (wpactrl_flags_scan(s + pos + 1, sa) != len - pos - 1) goto eproto ;
   sr.flags_len = sa->len - sr.flags_start ;
   len = pos ;
 
   pos = byte_rchr(s, len - 1, '\t') ;
   if (!pos || pos >= len - 1) goto eproto ;
-  if (wpactrl_bssid_scan(s + pos + 1, sr.bssid) != len - 1) goto eproto ;
+  if (wpactrl_bssid_scan(s + pos + 1, sr.bssid) != len - pos - 1) goto eproto ;
   len = pos ;
 
   sr.ssid_start = sa->len ;