]> granicus.if.org Git - sudo/commitdiff
paranoia when stripping trailing slashes from tempdir.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 17 Nov 2004 15:33:45 +0000 (15:33 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 17 Nov 2004 15:33:45 +0000 (15:33 +0000)
sudo_edit.c

index 3d8d94089d3d2b1f38dc389a0bc305da971a294a..d5e71ad88a651d71a70422f39b1aff012b55e384 100644 (file)
@@ -91,7 +91,7 @@ int sudo_edit(argc, argv)
     else
        tmpdir = _PATH_TMP;
     tmplen = strlen(tmpdir);
-    while (tmpdir[tmplen - 1] == '/')
+    while (tmplen > 0 && tmpdir[tmplen - 1] == '/')
        tmplen--;
 
     /*