From a7c4936942fad1890bab6d594b54f80f0cd89bc7 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sun, 11 Nov 2018 19:14:22 -0800 Subject: 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 --- binding/gdbus/ofono_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'binding/gdbus') 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; -- cgit 1.2.3-korg