Do not pass NULL paramenter to bsearch with empty filelist
A filelist can be non-NULL but empty (particularly with a lot of NoExtract entries). Handle this in alpm_filelist_contains() Identified using the undefined behaviour sanitizer. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
27eba85594
commit
0ccb584262
@ -123,7 +123,7 @@ alpm_file_t SYMEXPORT *alpm_filelist_contains(const alpm_filelist_t *filelist,
|
||||
{
|
||||
alpm_file_t key;
|
||||
|
||||
if(!filelist) {
|
||||
if(!filelist || filelist->count == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user