properly null-terminate formatted json strings

This commit is contained in:
Felix Fietkau 2011-02-07 01:18:56 +01:00
parent 6bbde6e647
commit a5e2b50652

View file

@ -263,5 +263,7 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, blobmsg_jso
return NULL; return NULL;
s.buf = realloc(s.buf, s.pos + 1); s.buf = realloc(s.buf, s.pos + 1);
s.buf[s.pos] = 0;
return s.buf; return s.buf;
} }