]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Fix adding neighbor entry
authorIlan Peer <ilan.peer@intel.com>
Thu, 27 Oct 2016 12:18:23 +0000 (15:18 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 29 Oct 2016 16:10:17 +0000 (19:10 +0300)
It is possible that a LCI or location civic configuration buffer
is valid but contains no data. In such a case do not add the LCI
and location civic information to the entry in the neighbor
data base.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
src/ap/neighbor_db.c

index a2efff6182868dda0a55c2238592dfc780add645..c6cdbfce28fbc65f6499493c064bae3bf43b4f20 100644 (file)
@@ -83,13 +83,13 @@ int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
        if (!entry->nr)
                goto fail;
 
-       if (lci) {
+       if (lci && wpabuf_len(lci)) {
                entry->lci = wpabuf_dup(lci);
                if (!entry->lci || os_get_time(&entry->lci_date))
                        goto fail;
        }
 
-       if (civic) {
+       if (civic && wpabuf_len(civic)) {
                entry->civic = wpabuf_dup(civic);
                if (!entry->civic)
                        goto fail;