Fossil SCM
checkin/f4f1c07153778c6c77f5c108a516af42f5e5f1835cac1042f44bac0f54ad1e64
Write through a null pointer in import --svn
svn_read_rec() in src/import.c assumed every header line of a Subversion
dump ends in a newline and wrote a zero byte where strchr() found one. A dump
cut off inside a header, a zero byte in a header line, or a line longer than
the 1,000-byte buffer has none, so the write went to address zero: a crash on
every build.
The fix refuses such a line with "svn-dump data format broken". One limit is left as it was: a header line of about 1,000 bytes or more, such as a very long path, is refused where it crashed before. A buffer that grows would remove it.
Tested with ASan and UBSan on macOS: each of the three kinds of line is
refused with no report, and the dumps written by Subversion itself import as
before. The tests are in test/import.test, which will come with the
test-suite work. Not run on Linux or Windows.