[PATCH 02/10] hostapd: Clear location configuration when it is reset

Andrei Otcheretianski andrei.otcheretianski at intel.com
Thu Oct 27 05:18:24 PDT 2016


From: Ilan Peer <ilan.peer at intel.com>

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 at intel.com>
---
 hostapd/config_file.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 8e7bcc7..4b49672 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -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] |=
-- 
1.9.1




More information about the Hostap mailing list