diff options
author | Howaner <franzi.moos@googlemail.com> | 2015-03-10 20:05:46 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2015-03-10 20:05:46 +0100 |
commit | ab420f6cfc8519fb2ec0caa7fb242517244ffcea (patch) | |
tree | c31c3538db081516d81959ed8ad00259175441a9 /src/HTTPServer/HTTPMessage.cpp | |
parent | Changed return type from AbsorbWater() to void. (diff) | |
parent | Fixed client kick/crash if many block changes happend (diff) | |
download | cuberite-ab420f6cfc8519fb2ec0caa7fb242517244ffcea.tar cuberite-ab420f6cfc8519fb2ec0caa7fb242517244ffcea.tar.gz cuberite-ab420f6cfc8519fb2ec0caa7fb242517244ffcea.tar.bz2 cuberite-ab420f6cfc8519fb2ec0caa7fb242517244ffcea.tar.lz cuberite-ab420f6cfc8519fb2ec0caa7fb242517244ffcea.tar.xz cuberite-ab420f6cfc8519fb2ec0caa7fb242517244ffcea.tar.zst cuberite-ab420f6cfc8519fb2ec0caa7fb242517244ffcea.zip |
Diffstat (limited to '')
-rw-r--r-- | src/HTTPServer/HTTPMessage.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/HTTPServer/HTTPMessage.cpp b/src/HTTPServer/HTTPMessage.cpp index d59ca438e..c87b3cc8b 100644 --- a/src/HTTPServer/HTTPMessage.cpp +++ b/src/HTTPServer/HTTPMessage.cpp @@ -55,7 +55,10 @@ void cHTTPMessage::AddHeader(const AString & a_Key, const AString & a_Value) } else if (Key == "content-length") { - m_ContentLength = static_cast<size_t>(atol(m_Headers[Key].c_str())); + if (!StringToInteger(m_Headers[Key], m_ContentLength)) + { + m_ContentLength = 0; + } } } |