Skip to content

Commit 9bd3b14

Browse files
committed
fix possible information leak
1 parent 6c9b82b commit 9bd3b14

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: framework/common/messageheaderparser.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ namespace tnt
204204
break;
205205
}
206206

207+
*headerdataPtr = '\0';
207208
return true;
208209
}
209210
else if (std::isspace(ch))
@@ -259,7 +260,10 @@ namespace tnt
259260
void Messageheader::Parser::checkHeaderspace(unsigned chars) const
260261
{
261262
if (headerdataPtr + chars >= header.rawdata + sizeof(header.rawdata))
263+
{
264+
header.rawdata[sizeof(header.rawdata) - 1] = '\0';
262265
throw HttpError(HTTP_REQUEST_ENTITY_TOO_LARGE, "header too large");
266+
}
263267
}
264268

265269
void Messageheader::Parser::reset()

0 commit comments

Comments
 (0)