summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Message.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-03-22 13:32:20 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-03-22 13:32:20 (GMT)
commit75c3239c820cfbd7c903cb30de06aebab112e4c2 (patch)
tree9a7eed459a1950714b8ec5ca3b379156b46452b8 /src/uscxml/Message.cpp
parentdbc9a01b53cf5d069a176f47d24de81c1c5efd69 (diff)
downloaduscxml-75c3239c820cfbd7c903cb30de06aebab112e4c2.zip
uscxml-75c3239c820cfbd7c903cb30de06aebab112e4c2.tar.gz
uscxml-75c3239c820cfbd7c903cb30de06aebab112e4c2.tar.bz2
Some minor bugfixes
- Disabled peer verification with ssl URLs - Fixed a buffer overrun with JSON parsing - Changed test.php url to github
Diffstat (limited to 'src/uscxml/Message.cpp')
-rw-r--r--src/uscxml/Message.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/uscxml/Message.cpp b/src/uscxml/Message.cpp
index c8c4b28..13b0b55 100644
--- a/src/uscxml/Message.cpp
+++ b/src/uscxml/Message.cpp
@@ -195,12 +195,12 @@ Data Data::fromJSON(const std::string& jsonString) {
free(t);
// LOG(INFO) << "Increasing JSON length to token ratio to 1/" << frac;
}
- t = (jsmntok_t*)malloc(nrTokens * sizeof(jsmntok_t));
+ t = (jsmntok_t*)malloc(nrTokens * sizeof(jsmntok_t) + 1);
if (t == NULL) {
LOG(ERROR) << "Cannot parse JSON, ran out of memory!";
return data;
}
- memset(t, 0, nrTokens * sizeof(jsmntok_t));
+ memset(t, 0, nrTokens * sizeof(jsmntok_t) + 1);
rv = jsmn_parse(&p, jsonString.c_str(), t, nrTokens);
} while (rv == JSMN_ERROR_NOMEM && frac > 1);