From: Todd C. Miller Date: Wed, 17 Nov 2004 15:33:45 +0000 (+0000) Subject: paranoia when stripping trailing slashes from tempdir. X-Git-Tag: SUDO_1_7_0~811 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88ce50751ec3bc92e24b1318d3c8c1dc2e0cbf81;p=sudo paranoia when stripping trailing slashes from tempdir. --- diff --git a/sudo_edit.c b/sudo_edit.c index 3d8d94089..d5e71ad88 100644 --- a/sudo_edit.c +++ b/sudo_edit.c @@ -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--; /*