From: Todd C. Miller Date: Thu, 14 Nov 1996 00:04:11 +0000 (+0000) Subject: off by one error in path size check X-Git-Tag: SUDO_1_5_3~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa54c845ed43b6b7d24f1d344f9c80887c057358;p=sudo off by one error in path size check --- 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); }