Warned-by: coverity
@@ -7,6 +7,7 @@ dpkg (1.17.11) UNRELEASED; urgency=low
* Update some dpkg git URLs to the new and newer (cgit switch) scheme.
* Changes to libcompat:
- Make the library testable.
+ - Do not run qsort() over the scandir() list if it is NULL.
[ Updated programs translations ]
* Danish (Joe Dalton). Closes: #754127
@@ -90,7 +90,7 @@ scandir(const char *dir, struct dirent ***namelist,
closedir(d);
- if (cmp != NULL)
+ if (list != NULL && cmp != NULL)
qsort(list, used, sizeof(struct dirent *), cmp);
*namelist = list;