libpkgconf: pkg: handle error value from stat(2).

pull/116/head
William Pitcock 2017-01-22 23:07:39 -06:00
parent 67796a1d86
commit e5f3dac6e7
1 changed files with 3 additions and 1 deletions

View File

@ -452,7 +452,9 @@ pkgconf_pkg_scan_dir(pkgconf_client_t *client, const char *path, void *data, pkg
pkgconf_strlcat(filebuf, "/", sizeof filebuf);
pkgconf_strlcat(filebuf, dirent->d_name, sizeof filebuf);
stat(filebuf, &st);
if (stat(filebuf, &st) == -1)
continue;
if (!(S_ISREG(st.st_mode)))
continue;