summaryrefslogtreecommitdiff
path: root/debian/patches/03-json-nul-terminator.patch
blob: 783a555ca512017d11242a21e264a545abf44528 (plain)
1
2
3
4
5
6
7
8
9
10
11
--- a/template.c
+++ b/template.c
@@ -361,7 +361,7 @@ tplToJSON(struct template *pTpl, msg_t *pMsg, struct json_object **pjson, struct
 							   pTpe->data.field.propName,  &propLen,
 							   &bMustBeFreed, ttNow);
 				if(pTpe->data.field.options.bMandatory || propLen > 0) {
-					jsonf = json_object_new_string_len((char*)pVal, propLen);
+					jsonf = json_object_new_string_len((char*)pVal, propLen+1);
 					json_object_object_add(json, (char*)pTpe->fieldName, jsonf);
 				}
 				if(bMustBeFreed) { /* json-c makes its own private copy! */