Fossil SCM
checkin/3e2c8b93cdcb55e0ded42245488e2cd1777d16bc24d4f521b846bd758ab5a745
5 days, 14 hours ago by dmestas
Overread of a commit name in import --git
For a commit command, fossil import --git looks for the slash that ends the
refs/... prefix of the name. The scan had no bound and read the byte after
the slash it had not found. A long name with no slash read past the line buffer
on the stack; a short one took its branch name from bytes left over from an
earlier line.
The fix keeps the scan and the tests within the name. Branch names from real exports are unchanged.
Tested with ASan and UBSan on macOS: the stream ASan stopped on before the fix
now gives no report, and the branch names of the other git dumps in the tests
are the same as before. The tests are in test/import.test, which will come
with the test-suite work. Not run on Linux or Windows.