off by one error in path size check
This commit is contained in:
@@ -160,8 +160,7 @@ char * find_path(file)
|
|||||||
/*
|
/*
|
||||||
* resolve the path and exit the loop if found
|
* resolve the path and exit the loop if found
|
||||||
*/
|
*/
|
||||||
if (strlen(path) + strlen(file) >= MAXPATHLEN) {
|
if (strlen(path) + strlen(file) + 1 >= MAXPATHLEN) {
|
||||||
errno = ENAMETOOLONG;
|
|
||||||
(void) fprintf(stderr, "%s: path too long: %s\n", Argv[0], file);
|
(void) fprintf(stderr, "%s: path too long: %s\n", Argv[0], file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user