Skip to content

Commit

Permalink
hostapd: add missing NULL pointer check in uc_hostapd_iface_stop
Browse files Browse the repository at this point in the history
Avoid crashing if the interface has already been removed

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed Sep 20, 2023
1 parent 7354d17 commit 4145ff4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package/network/services/hostapd/src/src/ap/ucode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4145ff4

Please sign in to comment.