All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] shared/gatt-client: Fix crash on ext prop read failure
@ 2018-07-26 14:34 Szymon Janc
  2018-07-27 12:08 ` Szymon Janc
  0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2018-07-26 14:34 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.
ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0,
    length=0, user_data=0x72ad30) at src/shared/gatt-client.c:711
711     src/shared/gatt-client.c: No such file or directory.
(gdb) bt
0  ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0,
                     length=0, user_data=0x72ad30)
   at src/shared/gatt-client.c:711
1  0x000000000049b8cc in disc_att_send_op (data=0x7199b0)
   at src/shared/att.c:547
2  0x000000000049cb44 in disconnect_cb (io=<optimized out>,
                       user_data=0x716070) at src/shared/att.c:580
3  0x00000000004a6405 in watch_callback (channel=<optimized out>,
                      cond=<optimized out>, user_data=<optimized out>)
   at src/shared/io-glib.c:170
4  0x00007ffff78c704a in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
5  0x00007ffff78c73f0 in ?? ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
6  0x00007ffff78c7712 in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
7  0x000000000040c620 in main (argc=1, argv=0x7fffffffe5a8)
   at src/main.c:781
---
 src/shared/gatt-client.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 2e153db5c..3c2aa293b 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -708,6 +708,9 @@ static void ext_prop_read_cb(bool success, uint8_t att_ecode,
 	bool discovering;
 	struct gatt_db_attribute *desc_attr = NULL;
 
+	if (!success)
+		goto done;
+
 	util_debug(client->debug_callback, client->debug_data,
 				"Ext. prop value: 0x%04x", (uint16_t)value[0]);
 
-- 
2.17.1


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

* Re: [PATCH v2] shared/gatt-client: Fix crash on ext prop read failure
  2018-07-26 14:34 [PATCH v2] shared/gatt-client: Fix crash on ext prop read failure Szymon Janc
@ 2018-07-27 12:08 ` Szymon Janc
  0 siblings, 0 replies; 2+ messages in thread
From: Szymon Janc @ 2018-07-27 12:08 UTC (permalink / raw)
  To: linux-bluetooth

On Thursday, 26 July 2018 16:34:00 CEST Szymon Janc wrote:
> Program received signal SIGSEGV, Segmentation fault.
> 
> Program received signal SIGSEGV, Segmentation fault.
> ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0,
>     length=0, user_data=0x72ad30) at src/shared/gatt-client.c:711
> 711     src/shared/gatt-client.c: No such file or directory.
> (gdb) bt
> 0  ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0,
>                      length=0, user_data=0x72ad30)
>    at src/shared/gatt-client.c:711
> 1  0x000000000049b8cc in disc_att_send_op (data=0x7199b0)
>    at src/shared/att.c:547
> 2  0x000000000049cb44 in disconnect_cb (io=<optimized out>,
>                        user_data=0x716070) at src/shared/att.c:580
> 3  0x00000000004a6405 in watch_callback (channel=<optimized out>,
>                       cond=<optimized out>, user_data=<optimized out>)
>    at src/shared/io-glib.c:170
> 4  0x00007ffff78c704a in g_main_context_dispatch ()
>    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> 5  0x00007ffff78c73f0 in ?? ()
>    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> 6  0x00007ffff78c7712 in g_main_loop_run ()
>    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> 7  0x000000000040c620 in main (argc=1, argv=0x7fffffffe5a8)
>    at src/main.c:781
> ---
>  src/shared/gatt-client.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
> index 2e153db5c..3c2aa293b 100644
> --- a/src/shared/gatt-client.c
> +++ b/src/shared/gatt-client.c
> @@ -708,6 +708,9 @@ static void ext_prop_read_cb(bool success, uint8_t
> att_ecode, bool discovering;
>  	struct gatt_db_attribute *desc_attr = NULL;
> 
> +	if (!success)
> +		goto done;
> +
>  	util_debug(client->debug_callback, client->debug_data,
>  				"Ext. prop value: 0x%04x", (uint16_t)value[0]);

Applied.

-- 
pozdrawiam
Szymon Janc



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

end of thread, other threads:[~2018-07-27 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 14:34 [PATCH v2] shared/gatt-client: Fix crash on ext prop read failure Szymon Janc
2018-07-27 12:08 ` Szymon Janc

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.