Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: src/device.c

Issue 6821048: flimflam: Don't crash if LockType/RetriesLeft are not specified. (Closed) Base URL: ssh://gitrw.chromium.org:9222/flimflam.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/device.c
diff --git a/src/device.c b/src/device.c
index c226acb6adfd4b39f4c95bdac4e6740faf91ff88..886a0938e0d279923518441b58807b06be6aa468 100644
--- a/src/device.c
+++ b/src/device.c
@@ -431,12 +431,14 @@ static void append_ipconfig(DBusMessageIter *dict, void *arg)
static void append_unlock_status(DBusMessageIter *dict, void *arg)
{
struct connman_device *device = arg;
- connman_dbus_dict_append_basic(dict, "LockType",
- DBUS_TYPE_STRING,
- &device->cellular.unlock_required);
- connman_dbus_dict_append_basic(dict, "RetriesLeft",
- DBUS_TYPE_UINT32,
- &device->cellular.unlock_retries);
+ if (device->cellular.unlock_required)
+ connman_dbus_dict_append_basic(dict, "LockType",
+ DBUS_TYPE_STRING,
+ &device->cellular.unlock_required);
+ if (device->cellular.unlock_retries)
+ connman_dbus_dict_append_basic(dict, "RetriesLeft",
+ DBUS_TYPE_UINT32,
+ &device->cellular.unlock_retries);
}
static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698