]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
http: refuse to deal with >4GB chunks in uploads
authorEric Wong <e@80x24.org>
Sat, 5 Apr 2025 17:44:13 +0000 (17:44 +0000)
committerEric Wong <e@80x24.org>
Tue, 8 Apr 2025 20:43:17 +0000 (20:43 +0000)
commitb2b864e489b00185f7139a5b3de099598dbecdad
tree0747cf953165bd79b645fc7fa764aedf4d3f0c66
parentfbf66f6f4196a118369aff2cd15542683d19523c
http: refuse to deal with >4GB chunks in uploads

The `hex' perlop will return an NV (typically 64-bit double) on
UV (unsigned int) overflow and warns on larger values.  While
64-bit integer builds of 32-bit perl (e.g. Debian i386) can
handle 64-bit numbers, there are builds of perl which still use
32-bit integers nowadays (e.g. OpenBSD 7.x i386).

It's unlikely we'll ever see chunks even close to 4GB, so just
cap it at 8 hex characters and drop clients which send larger
amounts.
lib/PublicInbox/HTTP.pm