0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 04:02:15 +02:00

httpcommon.hpp: Add missing cast from CONTENT_LENGTH_TYPE to size_t

With the std::max we do make sure it is > 0, so this
should be safe.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
Frank Lichtenheld 2023-08-16 11:17:05 +02:00 committed by David Sommerseth
parent 97924d6c92
commit cc5e61e81b
No known key found for this signature in database
GPG Key ID: 86CF944C9671FDF2

View File

@ -441,7 +441,7 @@ class HTTPBase : public REFCOUNT_BASE
}
else if (rr_content_length >= 0)
{
const size_t needed = std::max(rr_content_length - rr_content_bytes, CONTENT_LENGTH_TYPE(0));
const size_t needed = static_cast<size_t>(std::max(rr_content_length - rr_content_bytes, CONTENT_LENGTH_TYPE(0)));
if (needed <= buf.size())
{
done = true;