1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

resolve: fix NULL-pointer dereference

Fixes a bug introduced by 16a6bc5a7a.
Fixes CID#1501514.
This commit is contained in:
Yu Watanabe 2022-12-14 16:10:05 +09:00
parent b1c4466bba
commit 863b620a4a

View File

@ -486,7 +486,7 @@ static int etc_hosts_lookup_by_name(
break;
}
SET_FOREACH(a, item->addresses) {
SET_FOREACH(a, item ? item->addresses : NULL) {
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL;
if ((!found_a && a->family == AF_INET) ||