diff options
author | Zhenhua Zhang <zhenhua.zhang@intel.com> | 2010-08-20 11:10:39 +0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-08-20 10:20:39 +0200 |
commit | 2084fffed06f600ba7f884b00786923215a13fd9 (patch) | |
tree | 21546a14b1aa9a351d830bb7c8aee056fcf39494 /plugins/udev.c | |
parent | 5e9d957fb9c48491004070924ec561c7a0ef07ec (diff) | |
download | ofono-2084fffed06f600ba7f884b00786923215a13fd9.tar.bz2 |
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.
Diffstat (limited to 'plugins/udev.c')
-rw-r--r-- | plugins/udev.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |