Skip to content
Browse files

fix possible information leak

  • Loading branch information...
1 parent 6c9b82b commit 9bd3b14042e12d84f39ea9f55731705ba516f525 @maekitalo committed Dec 11, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 framework/common/messageheaderparser.cpp
View
4 framework/common/messageheaderparser.cpp
@@ -204,6 +204,7 @@ namespace tnt
break;
}
+ *headerdataPtr = '\0';
return true;
}
else if (std::isspace(ch))
@@ -259,7 +260,10 @@ namespace tnt
void Messageheader::Parser::checkHeaderspace(unsigned chars) const
{
if (headerdataPtr + chars >= header.rawdata + sizeof(header.rawdata))
+ {
+ header.rawdata[sizeof(header.rawdata) - 1] = '\0';
throw HttpError(HTTP_REQUEST_ENTITY_TOO_LARGE, "header too large");
+ }
}
void Messageheader::Parser::reset()

0 comments on commit 9bd3b14

Please sign in to comment.
Something went wrong with that request. Please try again.