From: Todd C. Miller Date: Sun, 27 Mar 2011 15:02:18 +0000 (-0400) Subject: Fix a potential crash when a non-regular file is present in an X-Git-Tag: SUDO_1_7_6~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e27ad0abc31f9146fad7bfa9dec9a2069e5d3e2e;p=sudo Fix a potential crash when a non-regular file is present in an includedir. Fixes bz #452 --HG-- branch : 1.7 --- diff --git a/toke.c b/toke.c index 7326b61ec..fbc334554 100644 --- a/toke.c +++ b/toke.c @@ -3358,6 +3358,7 @@ switch_dir(stack, dirpath) } if (stat(path, &sb) != 0 || !S_ISREG(sb.st_mode)) { efree(path); + path = NULL; continue; } pl = malloc(sizeof(*pl)); diff --git a/toke.l b/toke.l index 31936ba0c..15b3bd623 100644 --- a/toke.l +++ b/toke.l @@ -660,6 +660,7 @@ switch_dir(stack, dirpath) } if (stat(path, &sb) != 0 || !S_ISREG(sb.st_mode)) { efree(path); + path = NULL; continue; } pl = malloc(sizeof(*pl));