diff options
author | Brandon Williams <bmwill@google.com> | 2017-01-09 19:50:24 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-09 20:26:10 +0100 |
commit | 0b9864aa28ba08d7fb901afee1a75a15e4ad431b (patch) | |
tree | 77732f4692453697ef66e9b57086f530d21969d3 /abspath.c | |
parent | real_path: prevent redefinition of MAXSYMLINKS (diff) | |
download | git-0b9864aa28ba08d7fb901afee1a75a15e4ad431b.tar.xz git-0b9864aa28ba08d7fb901afee1a75a15e4ad431b.zip |
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 <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'abspath.c')
-rw-r--r-- | abspath.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |