diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-09-20 18:40:17 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-09-20 18:43:35 +0200 |
commit | eda1545e6ea64063d7ffa0a80067679e3bef105e (patch) | |
tree | 6ed1707ce93cba625be405a1664c161098ebfaa1 /package/network/services/hostapd | |
parent | 6019945e960d2e09ba71eaeb3e03686d871b53e4 (diff) | |
download | upstream-eda1545e6ea64063d7ffa0a80067679e3bef105e.tar.gz upstream-eda1545e6ea64063d7ffa0a80067679e3bef105e.tar.bz2 upstream-eda1545e6ea64063d7ffa0a80067679e3bef105e.zip |
hostapd: add missing NULL pointer check in uc_hostapd_iface_stop
Avoid crashing if the interface has already been removed
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 4145ff4d8a29c1c7a1569bb06fa4d1fe9808c94f)
Diffstat (limited to 'package/network/services/hostapd')
-rw-r--r-- | package/network/services/hostapd/src/src/ap/ucode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index e79f2420c0..ac3222b03f 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -471,6 +471,9 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs) struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); int i; + if (!iface) + return NULL; + switch (iface->state) { case HAPD_IFACE_ENABLED: case HAPD_IFACE_DISABLED: |