]> git.proxmox.com Git - libgit2.git/commit
Resolve crash with diff against empty file
authorRussell Belfer <rb@github.com>
Wed, 9 Jan 2013 01:11:11 +0000 (17:11 -0800)
committerRussell Belfer <rb@github.com>
Wed, 9 Jan 2013 01:11:11 +0000 (17:11 -0800)
commitde590550172c68bf374f9d12636b06295c5fe048
tree3bf0c7ca4b554784de72063b25933775308fb512
parentf7e4a7c2d5e314fe50fee851263e4ed6cfaa49ae
Resolve crash with diff against empty file

It is not legal inside our `p_mmap` function to mmap a zero length
file.  This adds a test that exercises that case inside diff and
fixes the code path where we would try to do that.

The fix turns out not to be a lot of code since our default file
content is already initialized to "" which works in this case.

Fixes #1210
src/diff_output.c
src/fileops.c
tests-clar/diff/workdir.c