Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-02-07 03:18:56 +0300
committerFelix Fietkau <nbd@openwrt.org>2011-02-07 03:18:56 +0300
commita5e2b50652d3f77886eca2489a1bfe6381155fde (patch)
tree183bf4ba12218f75cd1caffb694bd2ea7fbbe32b /blobmsg_json.c
parent6bbde6e647043344288c1da5d53726508a718ab8 (diff)
properly null-terminate formatted json strings
Diffstat (limited to 'blobmsg_json.c')
-rw-r--r--blobmsg_json.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/blobmsg_json.c b/blobmsg_json.c
index 896a9c2..8195763 100644
--- a/blobmsg_json.c
+++ b/blobmsg_json.c
@@ -263,5 +263,7 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, blobmsg_jso
return NULL;
s.buf = realloc(s.buf, s.pos + 1);
+ s.buf[s.pos] = 0;
+
return s.buf;
}