]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Clear location configuration when it is reset
authorIlan Peer <ilan.peer@intel.com>
Thu, 27 Oct 2016 12:18:24 +0000 (15:18 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 29 Oct 2016 16:11:59 +0000 (19:11 +0300)
In case that LCI or location civic configuration is cleared,
free the buffer holding the corresponding information to avoid
cases that the information is considered as valid/useful.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
hostapd/config_file.c

index 8e7bcc7e7dfdcfe88a4a7f60f879d72bc65003b3..4b4967241443c27e65a3a47b94dfb57d891aee21 100644 (file)
@@ -3493,9 +3493,17 @@ static int hostapd_config_fill(struct hostapd_config *conf,
        } else if (os_strcmp(buf, "lci") == 0) {
                wpabuf_free(conf->lci);
                conf->lci = wpabuf_parse_bin(pos);
+               if (conf->lci && wpabuf_len(conf->lci) == 0) {
+                       wpabuf_free(conf->lci);
+                       conf->lci = NULL;
+               }
        } else if (os_strcmp(buf, "civic") == 0) {
                wpabuf_free(conf->civic);
                conf->civic = wpabuf_parse_bin(pos);
+               if (conf->civic && wpabuf_len(conf->civic) == 0) {
+                       wpabuf_free(conf->civic);
+                       conf->civic = NULL;
+               }
        } else if (os_strcmp(buf, "rrm_neighbor_report") == 0) {
                if (atoi(pos))
                        bss->radio_measurements[0] |=