Commit b0aba763 authored by Mathieu STEFANI's avatar Mathieu STEFANI

Fixed unitialized data in the parser

parent 29c0f686
......@@ -24,6 +24,12 @@ static constexpr char CRLF[] = {CR, LF};
namespace Private {
Parser::Buffer::Buffer()
: len(0)
{
memset(data, sizeof data, 0);
}
bool
Parser::Cursor::advance(size_t count)
{
......@@ -114,11 +120,15 @@ namespace Private {
else if (tryMatch("DELETE")) {
request->method = Method::Delete;
}
else {
raise("Lol wat");
}
auto n = cursor.next();
if (n == Cursor::Eof) return State::Again;
else if (n != ' ') raise("Malformed HTTP Request");
if (!cursor.advance(2)) return State::Again;
size_t start = cursor;
......
......@@ -131,6 +131,8 @@ namespace Private {
struct Parser {
struct Buffer {
Buffer();
char data[Const::MaxBuffer];
size_t len;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment