From aa54c845ed43b6b7d24f1d344f9c80887c057358 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 14 Nov 1996 00:04:11 +0000 Subject: [PATCH] off by one error in path size check --- find_path.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/find_path.c b/find_path.c index 71ec47860..c04c0dbf0 100644 --- a/find_path.c +++ b/find_path.c @@ -160,8 +160,7 @@ char * find_path(file) /* * resolve the path and exit the loop if found */ - if (strlen(path) + strlen(file) >= MAXPATHLEN) { - errno = ENAMETOOLONG; + if (strlen(path) + strlen(file) + 1 >= MAXPATHLEN) { (void) fprintf(stderr, "%s: path too long: %s\n", Argv[0], file); exit(1); } -- 2.50.1