diff options
author | Lénaïc Huard <lenaic@lhuard.fr> | 2020-04-01 23:45:08 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-04-02 10:18:56 +0200 |
commit | 61fd7d6720c562c88ab79062ff8d131e5e3c7b1b (patch) | |
tree | e39a4809d1ef392b279461ae7584d911a4bb26c0 /src/udev/net | |
parent | e7b0ea544004fec4bb97f8db35942a196126cc8c (diff) | |
download | systemd-61fd7d6720c562c88ab79062ff8d131e5e3c7b1b.tar.gz |
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
Diffstat (limited to 'src/udev/net')
-rw-r--r-- | src/udev/net/link-config.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 71946c9ecc..48039511fa 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: |