diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-11-13 16:34:46 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-11-13 16:34:46 +0100 |
commit | 5761e27db9bdf54ad3cec3571950ccb69206427c (patch) | |
tree | 15475a67b661e3c9622e3cf702c7c44b2690880d | |
parent | 589243c74c93bef948dfdd2dc3613041c58b6918 (diff) | |
download | lr-5761e27db9bdf54ad3cec3571950ccb69206427c.tar.gz lr-5761e27db9bdf54ad3cec3571950ccb69206427c.tar.xz lr-5761e27db9bdf54ad3cec3571950ccb69206427c.zip |
traverse: avoid out of bounds read
-rw-r--r-- | lr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lr.c b/lr.c index 08d849f..c680cd8 100644 --- a/lr.c +++ b/lr.c @@ -2259,7 +2259,7 @@ traverse(const char *path) } prefixl = strlen(path); - while (path[prefixl-1] == '/') + while (prefixl && path[prefixl-1] == '/') prefixl--; if (prefixl > PATH_MAX) { errno = ENAMETOOLONG; |