mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-07 05:30:14 +01:00
hw/xfree86: fix segfault in config parser when config dir is missing
Treat a scandir error from a missing (or unusable) directory return as if it simply returned no files at all, which is what we want. cc: Paulo Zanoni <przanoni@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
fd976e4051
commit
3824f558cc
1 changed files with 4 additions and 0 deletions
|
|
@ -852,6 +852,10 @@ OpenConfigDir(const char *path, const char *cmdline, const char *projroot,
|
|||
|
||||
/* match files named *.conf */
|
||||
num = scandir(dirpath, &list, ConfigFilter, alphasort);
|
||||
if (num < 0) {
|
||||
list = NULL;
|
||||
num = 0;
|
||||
}
|
||||
found = AddConfigDirFiles(dirpath, list, num);
|
||||
if (!found) {
|
||||
free(dirpath);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue