iwinfo: zero out ccode buffer since library doesn't
Making an ubus call iwinfo countrylist '{"device":"radio0"}' will result in some entries having garbage uninitialized stack bytes in the "code" fields. With this patch we zero-initialize the buffer that libiwinfo writes to, making it NUL-terminated so that behavior doesn't happen anymore. Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
This commit is contained in:
parent
73aea9b8b6
commit
f8174eacef
1 changed files with 1 additions and 1 deletions
2
iwinfo.c
2
iwinfo.c
|
@ -588,7 +588,7 @@ rpc_iwinfo_countrylist(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
int rv, len;
|
||||
char cur[3];
|
||||
char iso3166[3];
|
||||
char res[IWINFO_BUFSIZE];
|
||||
char res[IWINFO_BUFSIZE] = {0};
|
||||
const char *ccode;
|
||||
const struct iwinfo_iso3166_label *l;
|
||||
void *c, *d;
|
||||
|
|
Loading…
Reference in a new issue