From: Felix Fietkau Date: Mon, 7 Feb 2011 16:47:02 +0000 (+0100) Subject: validate blobmsg attributes before converting them to json X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=81839e259a5de56b6eaa487e53eda1ac29ab1c59;p=project%2Flibubox.git validate blobmsg attributes before converting them to json --- diff --git a/blobmsg_json.c b/blobmsg_json.c index 8195763..6a6014b 100644 --- a/blobmsg_json.c +++ b/blobmsg_json.c @@ -180,6 +180,9 @@ static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, boo void *data; int len; + if (!blobmsg_check_attr(attr, false)) + return; + if (!array && blobmsg_name(attr)[0]) { blobmsg_format_string(s, blobmsg_name(attr)); blobmsg_puts(s, ":", 1);