From: Lénaïc Huard Date: Wed, 1 Apr 2020 21:45:08 +0000 (+0200) Subject: udev: Fix SIGSEGV in AlternativeNamesPolicy handling X-Git-Tag: v246-rc1~664 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61fd7d6720c562c88ab79062ff8d131e5e3c7b1b;p=thirdparty%2Fsystemd.git udev: Fix SIGSEGV in AlternativeNamesPolicy handling The function sd_device_get_property_value has some paths where it exits without touching the n pointer. In those cases, n remained uninitialized until it was eventually read inside isempty where it caused the segmentation fault. Fixes #15078 --- diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 71946c9ecc7..48039511fa6 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -498,7 +498,7 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, if (config->alternative_names_policy) for (NamePolicy *p = config->alternative_names_policy; *p != _NAMEPOLICY_INVALID; p++) { - const char *n; + const char *n = NULL; switch (*p) { case NAMEPOLICY_DATABASE: