Restricted image size.

Fixes #1
This commit is contained in:
tastytea 2018-11-26 04:20:27 +01:00
parent b8ca3f6d13
commit 75841d87a4
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 8 additions and 0 deletions

View File

@ -56,6 +56,14 @@ const Request http::parse_request(const string &request)
size = static_cast<uint16_t>(std::stoul(answer));
}
}
if (size > 512)
{
size = 512;
}
if (size < 1)
{
size = 1;
}
}
return { digest, size };