Fossil SCM
checkin/94412d502b36ebd97a20d7eacbf23f2d018383f3f0354f3f8c701c0f8b49c2fd
5 days, 14 hours ago by dmestas
Header lines added through a redirect
cgi_redirect_with_status() in src/cgi.c writes the target of a redirect
into the Location header. A target taken from the request, such as the
fossil-goto value after a login, that held a carriage return or a line feed
ended the header line there, and the rest of it became header lines of its
own.
The fix ends the target at its first control character.
Tested with ASan and UBSan on macOS: the request that added a header line
before the fix now gets a reply with one Location line and no other change,
and redirects without control characters are as before. The tests will come
with the test-suite work. Not run on Linux or Windows.