Skip to content
Permalink
Browse files Browse the repository at this point in the history
fix possible information leak
  • Loading branch information
maekitalo committed Dec 11, 2013
1 parent 6c9b82b commit 9bd3b14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions framework/common/messageheaderparser.cpp
Expand Up @@ -204,6 +204,7 @@ namespace tnt
break;
}

*headerdataPtr = '\0';
return true;
}
else if (std::isspace(ch))
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9bd3b14

Please sign in to comment.