fix overflow check

This commit is contained in:
Christian Grothoff
2026-07-08 12:09:38 +02:00
parent b4165ecc09
commit f10d7c71ab
+2 -1
View File
@@ -532,7 +532,8 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
mhd_assert (end_key >= start_key);
key_len = (size_t) (end_key - start_key);
mhd_assert (0 != key_len); /* it must be always non-zero here */
if (pp->buffer_pos + key_len >= pp->buffer_size)
if ( (pp->buffer_pos + key_len >= pp->buffer_size) ||
(pp->buffer_pos + key_len < pp->buffer_pos) )
{
pp->state = PP_Error;
return MHD_NO;