Skip to content
Fossil Update of ”checkin/7a8975dd84db67546bca0be02f33e2b045090182488e2c21b88a41b6ccff83d6”
Login

Update of ”checkin/7a8975dd84db67546bca0be02f33e2b045090182488e2c21b88a41b6ccff83d6”

Overview

Artifact ID: 9029d83006167d04ba95919cfca69618d4ccd05515b2fda7b863d252826ac153
Page Name:checkin/7a8975dd84db67546bca0be02f33e2b045090182488e2c21b88a41b6ccff83d6
Date: 2026-11-22 15:53:30
Original User: dmestas
Mimetype:text/x-markdown
Content

Overread and overflow in manifest_reparent_checkin()

manifest_reparent_checkin() in src/manifest.c splits the value of a parent tag into check-in hashes. It began scanning each hash 40 bytes in, without knowing the hash was that long, and stored each hash before checking the count against the size of its array. A malformed value read past the end of its copy, or wrote a pointer one entry past the end of the array. The code runs for a tag artifact that arrives by sync from a user who may push, and again on every rebuild of a repository that holds one.

The fix measures each hash from its start, checks the count before storing a hash, and stores only a value that is a valid hash.

Reviewed with 31 chosen and 300 random values in a harness that runs the old and the new loop: the old one overflowed on 32 of them and the new one on none, and every other value gives the same result in both. Tested with ASan and UBSan on macOS. The tests are in test/crosslink.test, which will come with the test-suite work. Not run on Linux or Windows.