From 2084fffed06f600ba7f884b00786923215a13fd9 Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Fri, 20 Aug 2010 11:10:39 +0800 Subject: udev: Add check for serial before string operation 'serial' could be NULL in some case. So it need to add check before doing string operation. --- plugins/udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/udev.c') diff --git a/plugins/udev.c b/plugins/udev.c index 84399ded..6720a0cd 100644 --- a/plugins/udev.c +++ b/plugins/udev.c @@ -86,7 +86,7 @@ static const char *get_serial(struct udev_device *udev_device) entry = udev_list_entry_get_next(entry); } - if (strpbrk(serial, ".-_?*") != NULL) + if (serial && strpbrk(serial, ".-_?*") != NULL) return NULL; return serial; -- cgit v1.2.3