mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-14 23:38:06 +02:00
dns: fix infinite loop in assertion checking search domains
The loop condition checked the same pointer twice instead of checking the array element: `ip_data->domains.search && ip_data->domains.search` should be `ip_data->domains.search && ip_data->domains.search[i]`. As written, the loop would never terminate when `search` is non-NULL (only in debug builds with NM_MORE_ASSERTS > 5). Found by Coverity (CID: CONSTANT_EXPRESSION_RESULT). Fixes:b8dab47705('dns: fix handling default routing domains with systemd-resolved') Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit8685ac1845)
This commit is contained in:
parent
99028b39a8
commit
51027cab73
1 changed files with 1 additions and 1 deletions
|
|
@ -371,7 +371,7 @@ _ASSERT_dns_config_ip_data(const NMDnsConfigIPData *ip_data)
|
|||
gboolean has_default = FALSE;
|
||||
gsize i;
|
||||
|
||||
for (i = 0; ip_data->domains.search && ip_data->domains.search; i++) {
|
||||
for (i = 0; ip_data->domains.search && ip_data->domains.search[i]; i++) {
|
||||
const char *d = ip_data->domains.search[i];
|
||||
|
||||
d = nm_utils_parse_dns_domain(d, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue