apply: do not read from beyond a symbolic link
authorJunio C Hamano <gitster@pobox.com>
Fri, 30 Jan 2015 23:34:13 +0000 (15:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Feb 2015 21:41:39 +0000 (13:41 -0800)
commitfdc2c3a926c21e24986677abd02c8bc568a5de32
tree1ee77daa3090efe28fa2fc2659863fba6e2793d3
parent3c37a2e339e695c7cc41048fe0921cbc8b48b0f0
apply: do not read from beyond a symbolic link

We should reject a patch, whether it renames/copies dir/file to
elsewhere with or without modificiation, or updates dir/file in
place, if "dir/" part is actually a symbolic link to elsewhere,
by making sure that the code to read the preimage does not read
from a path that is beyond a symbolic link.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c
t/t4122-apply-symlink-inside.sh