summaryrefslogtreecommitdiff
path: root/tests/diff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-07-05 13:30:46 +0200
committerPatrick Steinhardt <ps@pks.im>2018-07-05 13:42:14 +0200
commite087c0de70f43956125cb4deacdc8dd2a8687367 (patch)
treee2f2c4b7b5fb14c198bd9da4ab7eedb92953be4a /tests/diff
parent24597812220325f1cb38f61e56b095ff38d1b1cb (diff)
downloadlibgit2-e087c0de70f43956125cb4deacdc8dd2a8687367.tar.gz
delta: fix overflow when computing limit
When checking whether a delta base offset and length fit into the base we have in memory already, we can trigger an overflow which breaks the check. This would subsequently result in us reading memory from out of bounds of the base. The issue is easily fixed by checking for overflow when adding `off` and `len`, thus guaranteeting that we are never indexing beyond `base_len`. This corresponds to the git patch 8960844a7 (check patch_delta bounds more carefully, 2006-04-07), which adds these overflow checks. Reported-by: Riccardo Schirone <rschiron@redhat.com>
Diffstat (limited to 'tests/diff')
0 files changed, 0 insertions, 0 deletions