aboutsummaryrefslogtreecommitdiffstats
path: root/binding/gdbus/ofono_manager.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-11-11 19:14:22 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-11-11 19:20:12 -0800
commit6ad90c4c5a9558848d4684868a59cd83f8751110 (patch)
tree8252bec4c4749fd93d90cc52d66c952a4642f18a /binding/gdbus/ofono_manager.c
parent84935e2555fea382d2ebdb41a7801eedd9797954 (diff)
binding: telephony: fix segfaulting when modem is connected
Serial field isn't always passed if the device isn't connected causing a segfault when strcmp() is called. Change-Id: I0be1d9270a66df099786170136913a4b5525d582 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/gdbus/ofono_manager.c')
-rw-r--r--binding/gdbus/ofono_manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/binding/gdbus/ofono_manager.c b/binding/gdbus/ofono_manager.c
index ebe1412..1086beb 100644
--- a/binding/gdbus/ofono_manager.c
+++ b/binding/gdbus/ofono_manager.c
@@ -70,7 +70,7 @@ int ofono_manager_set_default_modem(const char *address)
type = g_variant_get_string(value, NULL);
}
/* If the HFP modem matches the BT address, is powered, and online then set as default */
- if (!strcmp(type, "hfp") && !strcmp(address, serial) && powered && online) {
+ if (!g_strcmp0(type, "hfp") && !g_strcmp0(address, serial) && powered && online) {
default_modem.address = serial;
default_modem.path = path;
default_modem.name = name;