Fossil SCM
checkin/256a070d8cab5e49222ca5948114603874a10c99a510b13485155bb47e1345ad
5 days, 14 hours ago by dmestas
/bloblist with n=0 never ended
The index of ranges on /bloblist in src/name.c steps through the
repository by the n= parameter. With n of zero or less it never reached the
end, so one request from anyone with Read, which on most public repositories
includes anonymous visitors, ran until it was killed, its output growing all
the while. A very large n also overflowed the end of the range.
The fix takes an n below one as one, and computes the end of the range in 64
bits.
Tested with ASan and UBSan on macOS: the requests that never ended now answer at once, the overflow is gone, and ordinary requests give the same page as before. The review repeated this on a repository of 3,002 artifacts. Not run on Linux or Windows.