json: fix malformed output

Even though the json output callback is called with a null terminated
string, it's not useable directly. The size parameter to the callback
might be a lot smaller than the string size. Libjansson gives the size
up to the first point that needs escaping.
pull/1754/head
Victor Julien 10 years ago
parent c80990fe10
commit bec913b40c

@ -345,7 +345,7 @@ static int MemBufferCallback(const char *str, size_t size, void *data)
MemBufferExpand(&memb, OUTPUT_BUFFER_SIZE);
}
#endif
MemBufferWriteString(memb, "%s", str);
MemBufferWriteRaw(memb, str, size);
return 0;
}

Loading…
Cancel
Save