Commit 5761e27d authored by Leah Neukirchen's avatar Leah Neukirchen

traverse: avoid out of bounds read

parent 589243c7
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment