sd-device: fix segfault when error occurs in device_new_from_{nulstr,strv}()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 22 Dec 2018 18:06:47 +0000 (03:06 +0900)
committerMichael Biebl <biebl@debian.org>
Sat, 12 Jan 2019 20:49:44 +0000 (20:49 +0000)
commit3940115328af7c68137c29d998ce4a5c8076f71d
treef8cad7be1e46070583b5d325b8a56b718dec138b
parent172b45521ca97fcdc308021cb584d339193e27b4
sd-device: fix segfault when error occurs in device_new_from_{nulstr,strv}()

As devpath may not be set yet.

When debug logging is enabled, log_device_*() calls
sd_device_get_sysname(). So, we should not assume that devpath is always
set.

Fixes #11258.

(cherry picked from commit 18fee12a2d489378a2a9b647db0d0eb8c43f5362)
(cherry picked from commit 9ae73a6273461361eef7e83d48aadee111d6616e)

Gbp-Pq: Name sd-device-fix-segfault-when-error-occurs-in-device_new_fr.patch
src/libsystemd/sd-device/sd-device.c