mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-18 18:56:37 +00:00
hostapd: clear ucode interface/bss resource pointers
Avoids potential use-after-free bugs Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
36a9f8449c
commit
ea1787b7bc
@ -298,9 +298,15 @@ uc_value_t *wpa_ucode_registry_get(uc_value_t *reg, int idx)
|
|||||||
uc_value_t *wpa_ucode_registry_remove(uc_value_t *reg, int idx)
|
uc_value_t *wpa_ucode_registry_remove(uc_value_t *reg, int idx)
|
||||||
{
|
{
|
||||||
uc_value_t *val = wpa_ucode_registry_get(reg, idx);
|
uc_value_t *val = wpa_ucode_registry_get(reg, idx);
|
||||||
|
void **dataptr;
|
||||||
|
|
||||||
if (val)
|
if (!val)
|
||||||
ucv_array_set(reg, idx - 1, NULL);
|
return NULL;
|
||||||
|
|
||||||
|
ucv_array_set(reg, idx - 1, NULL);
|
||||||
|
dataptr = ucv_resource_dataptr(val, NULL);
|
||||||
|
if (dataptr)
|
||||||
|
*dataptr = NULL;
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user