summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2019-06-16 22:24:36 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2019-06-16 22:41:26 +0200
commit91fcac34ac014a565fdd6312de088d312b5ba7ec (patch)
tree3b7b812cdb229877f8c1bf11330abf620e7e39d0 /proc.c
parentcdfc902a4cb77bc538a729f9e1c8a8578454a0e5 (diff)
uhttpd: Fix multiple format string problems
After format string checks were activated in libubox the compiler started to complain about multiple missuses in uhttpd. This fixes the format strings without changing the behavior. blobmsg_get_string() just checks if the parameter is not NULL and then calls blobmsg_data() and casts the result. I think non of these problem is security relevant. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index 88ec31e..1d63d86 100644
--- a/proc.c
+++ b/proc.c
@@ -232,7 +232,8 @@ static void proc_handle_header_end(struct relay *r)
uloop_timeout_cancel(&p->timeout);
uh_http_header(cl, cl->dispatch.proc.status_code, cl->dispatch.proc.status_msg);
blob_for_each_attr(cur, cl->dispatch.proc.hdr.head, rem)
- ustream_printf(cl->us, "%s: %s\r\n", blobmsg_name(cur), blobmsg_data(cur));
+ ustream_printf(cl->us, "%s: %s\r\n", blobmsg_name(cur),
+ blobmsg_get_string(cur));
ustream_printf(cl->us, "\r\n");