From: Kai Lüke Date: Fri, 24 Apr 2026 16:42:36 +0000 (+0900) Subject: nsresource: fix buffer overrun reported by ASAN X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41cf6891213dd78c5af3c2b8ff05194c52efa62f;p=thirdparty%2Fsystemd.git nsresource: fix buffer overrun reported by ASAN This came up when running systemd-vmspawn with ASAN to fix another bug and thus I had to fix this overrun here first: The dispatch tables were missing the terminator, add it. --- diff --git a/src/shared/nsresource.c b/src/shared/nsresource.c index 7a1c33446b8..b783cb80b78 100644 --- a/src/shared/nsresource.c +++ b/src/shared/nsresource.c @@ -372,6 +372,7 @@ int nsresource_add_netif_veth( static const sd_json_dispatch_field dispatch_table[] = { { "hostInterfaceName", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(InterfaceParams, host_interface_name), SD_JSON_MANDATORY }, { "namespaceInterfaceName", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(InterfaceParams, namespace_interface_name), SD_JSON_MANDATORY }, + {} }; _cleanup_(interface_params_done) InterfaceParams p = {}; @@ -437,6 +438,7 @@ int nsresource_add_netif_tap( static const sd_json_dispatch_field dispatch_table[] = { { "hostInterfaceName", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(InterfaceParams, host_interface_name), SD_JSON_MANDATORY }, { "interfaceFileDescriptor", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint, offsetof(InterfaceParams, interface_fd_index), SD_JSON_MANDATORY }, + {} }; _cleanup_(interface_params_done) InterfaceParams p = {};