Fix a potential crash when a non-regular file is present in an

includedir.  Fixes bz #452
This commit is contained in:
Todd C. Miller
2011-03-27 09:27:43 -04:00
parent 03f949cf1e
commit aed50b4d7b
2 changed files with 2 additions and 0 deletions

View File

@@ -3355,6 +3355,7 @@ switch_dir(struct include_stack *stack, char *dirpath)
}
if (stat(path, &sb) != 0 || !S_ISREG(sb.st_mode)) {
efree(path);
path = NULL;
continue;
}
pl = malloc(sizeof(*pl));

View File

@@ -656,6 +656,7 @@ switch_dir(struct include_stack *stack, char *dirpath)
}
if (stat(path, &sb) != 0 || !S_ISREG(sb.st_mode)) {
efree(path);
path = NULL;
continue;
}
pl = malloc(sizeof(*pl));