Fix a potential crash when a non-regular file is present in an
includedir. Fixes bz #452
This commit is contained in:
@@ -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));
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user