From d97fc0baf01b1a666429c4dfb8894bed0f7d895c Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 12 Aug 2012 13:26:16 +0200 Subject: [PATCH] uterm: monitor: fix crash during device hotplug We must make sure that the returned value is non-NULL, otherwise we crash during device-change events for non-DRM-Hotplug events. Signed-off-by: David Herrmann --- src/uterm_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uterm_monitor.c b/src/uterm_monitor.c index 3f9762c..b95082d 100644 --- a/src/uterm_monitor.c +++ b/src/uterm_monitor.c @@ -530,7 +530,7 @@ static void monitor_udev_change(struct uterm_monitor *mon, /* DRM devices send hotplug events; catch them here */ val = udev_device_get_property_value(dev, "HOTPLUG"); - if (!strcmp(val, "1")) { + if (val && !strcmp(val, "1")) { memset(&ev, 0, sizeof(ev)); ev.type = UTERM_MONITOR_HOTPLUG_DEV; ev.seat = sdev->seat;