summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/realpath.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c
index e4729a808..a6ac09ba5 100644
--- a/openbsd-compat/realpath.c
+++ b/openbsd-compat/realpath.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: realpath.c,v 1.18 2014/10/19 03:56:28 doug Exp $ */ 1/* $OpenBSD: realpath.c,v 1.19 2015/01/16 16:48:51 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2003 Constantin S. Svintsoff <kostik@iclub.nsu.ru> 3 * Copyright (c) 2003 Constantin S. Svintsoff <kostik@iclub.nsu.ru>
4 * 4 *
@@ -42,6 +42,7 @@
42#include <stddef.h> 42#include <stddef.h>
43#include <string.h> 43#include <string.h>
44#include <unistd.h> 44#include <unistd.h>
45#include <limits.h>
45 46
46/* A slightly modified copy of this file exists in libexec/ld.so */ 47/* A slightly modified copy of this file exists in libexec/ld.so */
47 48
@@ -164,7 +165,7 @@ realpath(const char *path, char *resolved)
164 goto err; 165 goto err;
165 } 166 }
166 if (S_ISLNK(sb.st_mode)) { 167 if (S_ISLNK(sb.st_mode)) {
167 if (symlinks++ > MAXSYMLINKS) { 168 if (symlinks++ > SYMLOOP_MAX) {
168 errno = ELOOP; 169 errno = ELOOP;
169 goto err; 170 goto err;
170 } 171 }