From 5761e27db9bdf54ad3cec3571950ccb69206427c Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 13 Nov 2017 16:34:46 +0100 Subject: traverse: avoid out of bounds read --- lr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit 1.4.1