From 624159e7ddede670fb3dafabb28093d72a3a12ac Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 29 May 2013 13:54:47 +0300 Subject: [PATCH] obexd: Fix not unregistering interface when a session is detroyed The path used for unregistering is wrong so the Session interface is still reachable after the object is destroyed which can cause crashes such as the following: invalid read of size 8 at 0x4297C4: get_destination (manager.c:286) by 0x41130B: properties_get (object.c:800) by 0x410710: process_message.isra.4 (object.c:258) by 0x3F3461D9C4: ??? (in /usr/lib64/libdbus-1.so.3.7.2) by 0x3F3460FC1F: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.2) by 0x40E207: message_dispatch (mainloop.c:76) by 0x3F31A485DA: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2) by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2) by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2) by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2) by 0x40DDB2: main (main.c:319) --- obexd/src/manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obexd/src/manager.c b/obexd/src/manager.c index d0991e901..72a62b001 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -845,7 +845,9 @@ done: void manager_unregister_session(struct obex_session *os) { - char *path = g_strdup_printf("%s/session%u", OBEX_BASE_PATH, os->id); + char *path; + + path = g_strdup_printf("%s/session%u", SESSION_BASE_PATH, os->id); g_dbus_unregister_interface(connection, path, SESSION_INTERFACE); -- 2.47.3