[PATCH] libnm: Warning if private data is NULL
- From: "Shih-Yuan Lee (FourDollars)" <sylee canonical com>
- To: networkmanager-list gnome org
- Subject: [PATCH] libnm: Warning if private data is NULL
- Date: Fri, 6 May 2016 14:01:07 +0800
Check the priv pointer before loop traverse.
Warning this instead of leaving the program crash directly.
---
libnm/nm-manager.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c
index a6c1f3f..7d86a51 100644
--- a/libnm/nm-manager.c
+++ b/libnm/nm-manager.c
@@ -816,6 +816,11 @@ recheck_pending_activations (NMManager *self)
const GPtrArray *devices;
NMDevice *device;
+ if (!priv) {
+ g_warning ("%s: private data should not be NULL", __func__);
+ return;
+ }
+
/* For each pending activation, look for an active connection that has the
* pending activation's object path, where the active connection and its
* device have both updated their properties to point to each other, and
--
2.7.4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]