From: Brandon Williams Date: Mon, 9 Jan 2017 18:50:24 +0000 (-0800) Subject: real_path: set errno when max number of symlinks is exceeded X-Git-Tag: v2.12.0-rc0~61^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0b9864aa28ba08d7fb901afee1a75a15e4ad431b;p=git-core%2Fgit.git real_path: set errno when max number of symlinks is exceeded Set errno to ELOOP when the maximum number of symlinks is exceeded, as would be done by other symlink-resolving functions. Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- diff --git a/abspath.c b/abspath.c index 0393213e5..fce40fddc 100644 --- a/abspath.c +++ b/abspath.c @@ -141,6 +141,8 @@ char *strbuf_realpath(struct strbuf *resolved, const char *path, strbuf_reset(&symlink); if (num_symlinks++ > MAXSYMLINKS) { + errno = ELOOP; + if (die_on_error) die("More than %d nested symlinks " "on path '%s'", MAXSYMLINKS, path);