From 0a1d0e8968d4c41aecf8f50956fb19dd725c3c78 Mon Sep 17 00:00:00 2001 From: Rakesh M K Date: Wed, 26 Nov 2014 16:32:44 +0530 Subject: [PATCH] obexd: Fix crash while session shutdown g_str_equal has been used for the session path compare which is not NULL-safe. Used the g_strcmp0() for the NULL-Safe string comparision. *#0 strcmp (p1=0x0, p2=0x7105c "/org/bluez/obex/client/session0") * at strcmp.c:38 *#1 0xb6e0cd0a in g_str_equal (v1=, * v2=) at ghash.c:1704 *#2 0x000264d8 in find_session (connection=, * message=0x55b38, user_data=) * at obexd/client/manager.c:162 *#3 remove_session (connection=, message=0x55b38, user_data=) at obexd/client/manager.c:231 --- obexd/client/manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obexd/client/manager.c b/obexd/client/manager.c index 8efe1f259..7ae111ca7 100644 --- a/obexd/client/manager.c +++ b/obexd/client/manager.c @@ -157,7 +157,7 @@ static struct obc_session *find_session(const char *path) for (l = sessions; l; l = l->next) { struct obc_session *session = l->data; - if (g_str_equal(obc_session_get_path(session), path) == TRUE) + if (g_strcmp0(obc_session_get_path(session), path) == 0) return session; } -- 2.47.3