aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Åldstedt Sund <erik.sund@conoptica.com>2017-10-23 23:16:16 +0200
committerErik Åldstedt Sund <erik.sund@conoptica.com>2017-10-30 20:50:17 +0100
commit29824c84ede1a696851a6aae99eeae64f9651fc1 (patch)
tree9ac88b89ad86682fa03be861b3317112248f4266
parent7f3f72441c242836d00ab2109a83baef89c08aaa (diff)
downloadcrow-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.
-rw-r--r--include/crow/json.h3
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);