All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1] obexd: Fix crash while session shutdown
@ 2014-11-26 11:02 Rakesh M K
  2014-11-26 14:16 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Rakesh M K @ 2014-11-26 11:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rakesh M K

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=<value optimized out>,
*    v2=<value optimized out>) at ghash.c:1704
*#2  0x000264d8 in find_session (connection=<value optimized out>,
*    message=0x55b38, user_data=<value optimized out>)
*    at obexd/client/manager.c:162
*#3  remove_session (connection=<value optimized out>, message=0x55b38,
    user_data=<value optimized out>) 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 8efe1f2..7ae111c 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;
 	}
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1] obexd: Fix crash while session shutdown
  2014-11-26 11:02 [PATCH 1] obexd: Fix crash while session shutdown Rakesh M K
@ 2014-11-26 14:16 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2014-11-26 14:16 UTC (permalink / raw)
  To: Rakesh M K; +Cc: linux-bluetooth

Hi,

On Wed, Nov 26, 2014 at 1:02 PM, Rakesh M K <rakesh.mk@samsung.com> wrote:
> 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=<value optimized out>,
> *    v2=<value optimized out>) at ghash.c:1704
> *#2  0x000264d8 in find_session (connection=<value optimized out>,
> *    message=0x55b38, user_data=<value optimized out>)
> *    at obexd/client/manager.c:162
> *#3  remove_session (connection=<value optimized out>, message=0x55b38,
>     user_data=<value optimized out>) 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 8efe1f2..7ae111c 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;
>         }
>
> --
> 1.7.9.5

Applied, thanks.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-26 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-26 11:02 [PATCH 1] obexd: Fix crash while session shutdown Rakesh M K
2014-11-26 14:16 ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.