]> git.ipfire.org Git - thirdparty/git.git/commit - diff.c
diff: fix lstat() error handling in diff_populate_filespec()
authorAndrey Okoshkin <a.okoshkin@samsung.com>
Fri, 27 Oct 2017 09:33:25 +0000 (12:33 +0300)
committerJunio C Hamano <gitster@pobox.com>
Sun, 29 Oct 2017 01:16:36 +0000 (10:16 +0900)
commit10e0ca843dea3e8135678600f22e0baa1edf6e44
tree4e6e9b164aaf5c3e77a1f42c58bdf54866cd3ba1
parent42e6fde5c28150206956ea4be490d886c4ecbd68
diff: fix lstat() error handling in diff_populate_filespec()

Add lstat() error handling not only for ENOENT case.
Otherwise uninitialised 'struct stat st' variable is used later in case of
lstat() non-ENOENT failure which leads to processing of rubbish values of
file mode ('S_ISLNK(st.st_mode)' check) or size ('xsize_t(st.st_size)').

Signed-off-by: Andrey Okoshkin <a.okoshkin@samsung.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c