projects
/
openwrt
/
staging
/
thess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3984fb0
)
hostapd: use strdup on string passed to hostapd_add_iface
author
Felix Fietkau
<nbd@nbd.name>
Fri, 14 Jun 2024 12:17:57 +0000
(14:17 +0200)
committer
Felix Fietkau
<nbd@nbd.name>
Fri, 21 Jun 2024 09:52:25 +0000
(11:52 +0200)
The data is modified within hostapd_add_iface
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/src/src/ap/ucode.c
patch
|
blob
|
history
diff --git
a/package/network/services/hostapd/src/src/ap/ucode.c
b/package/network/services/hostapd/src/src/ap/ucode.c
index d3441902086ebcaeb196c0096a54db981221f4a0..68fb450884e2f396adbe5398224ca62d876ad68b 100644
(file)
--- a/
package/network/services/hostapd/src/src/ap/ucode.c
+++ b/
package/network/services/hostapd/src/src/ap/ucode.c
@@
-86,12
+86,16
@@
static uc_value_t *
uc_hostapd_add_iface(uc_vm_t *vm, size_t nargs)
{
uc_value_t *iface = uc_fn_arg(0);
+ char *data;
int ret;
if (ucv_type(iface) != UC_STRING)
return ucv_int64_new(-1);
- ret = hostapd_add_iface(interfaces, ucv_string_get(iface));
+ data = strdup(ucv_string_get(iface));
+ ret = hostapd_add_iface(interfaces, data);
+ free(data);
+
hostapd_ucode_update_interfaces();
return ucv_int64_new(ret);