summaryrefslogtreecommitdiff
path: root/t/t4123-apply-shrink.sh
AgeCommit message (Collapse)AuthorFilesLines
2021-11-01leak tests: mark some apply tests as passing with SANITIZE=leakLibravatar Ævar Arnfjörð Bjarmason1-0/+2
Mark some tests that match "*apply*" as passing when git is compiled with SANITIZE=leak. They'll now be listed as running under the "GIT_TEST_PASSING_SANITIZE_LEAK=true" test mode (the "linux-leaks" CI target). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-05git-apply: do not read past the end of bufferLibravatar Junio C Hamano1-0/+58
When the preimage we are patching is shorter than what the patch text expects, we tried to match the buffer contents at the "original" line with the fragment in full, without checking we have enough data to match in the preimage. This caused the size of a later memmove() to wrap around and attempt to scribble almost the entire address space. Not good. The code that follows the part this patch touches tries to match the fragment with line offsets. Curiously, that code does not have the problem --- it guards against reading past the end of the preimage. Signed-off-by: Junio C Hamano <gitster@pobox.com>