]> granicus.if.org Git - sudo/commitdiff
off by one error in path size check
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 14 Nov 1996 00:04:11 +0000 (00:04 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 14 Nov 1996 00:04:11 +0000 (00:04 +0000)
find_path.c

index 71ec478606f80c656e8f0a6c67e6c7cc3ef039d4..c04c0dbf0602c361af464846217f0924fa1aafba 100644 (file)
@@ -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);
        }