diff options
author | Denis Osvald <denis.osvald@sartura.hr> | 2016-06-02 17:06:30 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2016-06-05 16:05:23 +0200 |
commit | f8174eacef9b687a83231e58fdd1e53492e3ca84 (patch) | |
tree | c379ab22f81951ad8f477ba84e1d0bf97c2600b2 | |
parent | 73aea9b8b621a1ce034bc6ee00c9d058a40c8a3d (diff) | |
download | rpcd-f8174eacef9b687a83231e58fdd1e53492e3ca84.tar.gz |
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>
-rw-r--r-- | iwinfo.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |