mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 01:22:25 +00:00
spotfilter: fix a use-after-free
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
committed by
jaspreetsachdev
parent
9c2f0a098d
commit
41c64e9978
@@ -65,6 +65,7 @@ static void __client_free(struct interface *iface, struct client *cl)
|
||||
avl_delete(&iface->client_ids, &cl->id_node);
|
||||
avl_delete(&iface->clients, &cl->node);
|
||||
kvlist_free(&cl->kvdata);
|
||||
free(cl->device);
|
||||
spotfilter_bpf_set_client(iface, &cl->key, NULL);
|
||||
free(cl);
|
||||
}
|
||||
@@ -143,8 +144,10 @@ int client_set(struct interface *iface, const void *addr, const char *id,
|
||||
|
||||
kvlist_set(&cl->kvdata, blobmsg_name(cur), cur);
|
||||
}
|
||||
if (device)
|
||||
cl->device = device;
|
||||
if (device) {
|
||||
free(cl->device);
|
||||
cl->device = strdup(device);
|
||||
}
|
||||
if (state >= 0)
|
||||
cl->data.cur_class = state;
|
||||
if (dns_state >= 0)
|
||||
|
||||
@@ -17,7 +17,7 @@ struct client {
|
||||
|
||||
struct spotfilter_client_key key;
|
||||
struct spotfilter_client_data data;
|
||||
const char *device;
|
||||
char *device;
|
||||
};
|
||||
|
||||
int client_set(struct interface *iface, const void *addr, const char *id,
|
||||
|
||||
Reference in New Issue
Block a user