[MM] [PATCH] device: check for NULL driver in add_port_driver
- From: Ben Chan <benchan chromium org>
- To: networkmanager-list gnome org
- Cc: Aleksander Morgado <aleksander lanedo com>
- Subject: [MM] [PATCH] device: check for NULL driver in add_port_driver
- Date: Fri, 17 May 2013 11:05:44 -0700
This patch fixes a crash in MMDevice::add_port_driver() due to
g_str_equal() dereferencing a NULL driver returned by
mm_device_utils_get_port_driver().
Bug reported on https://code.google.com/p/chromium/issues/detail?id=241823
---
src/mm-device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mm-device.c b/src/mm-device.c
index bfc4b36..54f6456 100644
--- a/src/mm-device.c
+++ b/src/mm-device.c
@@ -255,6 +255,8 @@ add_port_driver (MMDevice *self,
guint i;
driver = mm_device_utils_get_port_driver (udev_port);
+ if (!driver)
+ return;
n_items = (self->priv->drivers ? g_strv_length (self->priv->drivers) : 0);
if (n_items > 0) {
--
1.8.2.1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]