From a686cc2b22501ddcf93ed1edaa0fb24ef480f627 Mon Sep 17 00:00:00 2001 From: illiliti Date: Wed, 8 Jul 2020 19:39:18 +0300 Subject: [PATCH] check NULL --- udev_device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/udev_device.c b/udev_device.c index 61f2e39..e3689f8 100644 --- a/udev_device.c +++ b/udev_device.c @@ -382,9 +382,11 @@ void udev_device_set_properties_from_uevent(struct udev_device *udev_device) // Very very very dirty hack to detect INPUT properties. False positives are guaranteed void udev_device_set_properties_from_ioctl(struct udev_device *udev_device) { - const char *name; + const char *name, *subsystem; - if (strcmp(udev_device_get_subsystem(udev_device), "input") != 0) { + subsystem = udev_device_get_subsystem(udev_device); + + if (!subsystem || strcmp(subsystem, "input") != 0) { return; }