Skip to content

Commit

Permalink
udev_enumerate.c: fix endless loop in filter_property
Browse files Browse the repository at this point in the history
  • Loading branch information
illiliti committed Sep 5, 2021
1 parent 3c25933 commit c7669d8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions udev_enumerate.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,11 @@ static int filter_property(struct udev_enumerate *udev_enumerate, struct udev_de
property2 = udev_list_entry_get_name(list_entry2);
value2 = udev_list_entry_get_value(list_entry2);

if (!value || !value2) {
continue;
}

if (fnmatch(property, property2, 0) == 0 &&
fnmatch(value, value2, 0) == 0) {
return 1;
if (value && value2) {
if (fnmatch(property, property2, 0) == 0 &&
fnmatch(value, value2, 0) == 0) {
return 1;
}
}

list_entry2 = udev_list_entry_get_next(list_entry2);
Expand Down

0 comments on commit c7669d8

Please sign in to comment.