diff options
author | Todd C. Miller <Todd.Miller@courtesan.com> | 1996-11-14 00:04:11 +0000 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@courtesan.com> | 1996-11-14 00:04:11 +0000 |
commit | ee079c62de0b191a4e0a295513e729e9cd487455 (patch) | |
tree | d49ae5bfcd4f941448ad62a2c325bec21cf152ae /find_path.c | |
parent | 8eaa885b6419461caae62d2e7166346bb5f6c2d6 (diff) | |
download | sudo-ee079c62de0b191a4e0a295513e729e9cd487455.tar.gz |
off by one error in path size check
Diffstat (limited to 'find_path.c')
-rw-r--r-- | find_path.c | 3 |
1 files changed, 1 insertions, 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); } |