diff options
author | Erik Åldstedt Sund <erik.sund@conoptica.com> | 2017-10-23 23:16:16 +0200 |
---|---|---|
committer | Erik Åldstedt Sund <erik.sund@conoptica.com> | 2017-10-30 20:50:17 +0100 |
commit | 29824c84ede1a696851a6aae99eeae64f9651fc1 (patch) | |
tree | 9ac88b89ad86682fa03be861b3317112248f4266 /include | |
parent | 7f3f72441c242836d00ab2109a83baef89c08aaa (diff) | |
download | crow-29824c84ede1a696851a6aae99eeae64f9651fc1.tar.gz crow-29824c84ede1a696851a6aae99eeae64f9651fc1.zip |
Fixed bug in r_string: end of string pointer was not updated in the force member function
This could lead to undefined behaviour in the std::string conversion
operator, when using the iterator interface (begin() / end()), and the size()
member function.
Diffstat (limited to 'include')
-rw-r--r-- | include/crow/json.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/crow/json.h b/include/crow/json.h index d8dbace..1aa303e 100644 --- a/include/crow/json.h +++ b/include/crow/json.h @@ -168,9 +168,10 @@ namespace crow return os; } private: - void force(char* s, uint32_t /*length*/) + void force(char* s, uint32_t length) { s_ = s; + e_ = s_ + length; owned_ = 1; } friend rvalue crow::json::load(const char* data, size_t size); |