Skip to content
Fossil Update of ”checkin/22ed60a53b0acaae929ef374e5d03e18d9d6562c8cb4ccee809a14218399afd3”
Login

Update of ”checkin/22ed60a53b0acaae929ef374e5d03e18d9d6562c8cb4ccee809a14218399afd3”

Overview

Artifact ID: 2eb35ab7e79358949d9b612993b6be5a13e624f09bdfe516116a2636dbb17ac7
Page Name:checkin/22ed60a53b0acaae929ef374e5d03e18d9d6562c8cb4ccee809a14218399afd3
Date: 2026-11-22 15:53:29
Original User: dmestas
Mimetype:text/x-markdown
Content

Endless loop on a multipart header line

tokenize_line() in src/cgi.c splits the header lines of each part of multipart/form-data. It did not move past a double quote that was the last byte of a line, so its loop never ended. Any POST of that type, to a page that reads its parameters, before any login check, held a process at full CPU: for ever under fossil http and CGI, and until the 600-second limit under fossil server.

The fix steps over the quote.

The review proved that each pass now moves forward. Over every string of up to nine bytes made from the characters that matter, the old code looped on 43,946 and the new code on none, and wherever the old code finished both give the same tokens. Tested with ASan and UBSan on macOS; the test in test/cgi.test, which will come with the test-suite work, runs the request with a time limit. Not run on Linux or Windows.