From 530a8934f5b5711db2345b0d6900cf4b9aa6514c Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Tue, 7 Apr 2026 13:17:23 +0200 Subject: [PATCH] libnm: fix wrong variable in route attribute validation error message The validation checks 'addr' (the extracted address portion before '/') but the error message prints 'string' (the full input including the prefix). For input like "192.168.1.999/24", the error would show the full string instead of just the invalid address part. Found by Coverity (CID: COPY_PASTE_ERROR). Fixes: 539db43619e4 ('libnm: avoid heap allocation for checking valid routes in nm_ip_route_attribute_validate()') Co-Authored-By: Claude Opus 4.6 (cherry picked from commit 3d4ad7b4ba33a067396acb4a81f78273ada88b9a) --- src/libnm-core-impl/nm-setting-ip-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c index f4ee094ca4..1e9a780de4 100644 --- a/src/libnm-core-impl/nm-setting-ip-config.c +++ b/src/libnm-core-impl/nm-setting-ip-config.c @@ -1401,7 +1401,7 @@ _ip_route_attribute_validate(const char *name, NM_CONNECTION_ERROR_FAILED, family == AF_INET ? _("'%s' is not a valid IPv4 address") : _("'%s' is not a valid IPv6 address"), - string); + addr); return FALSE; } break;