bluez/gobex
Denis Grigorev 7a35c12a6c gobex: Fix segfault caused by interrupted transfer
When a obex transfer is interrupted by a peer in the middle, the response
G_OBEX_RSP_FORBIDDEN comes and the transfer is freed in transfer_complete.
However gobex is still ref'ed and gobex->io continues to be writable,
so write_data() and then g_obex_abort() are called. When the abort response
comes, struct obc_transfer is already freed, which leads to the crash.

Backtrace :
__GI___pthread_mutex_lock (mutex=0x65732f74) at pthread_mutex_lock.c:67
0xecc6eeda in dbus_connection_get_object_path_data () from libdbus-1.so.3
0x000457d4 in g_dbus_emit_property_changed_full () at gdbus/object.c:1794
0x00045868 in g_dbus_emit_property_changed () at gdbus/object.c:1832
0x000367f0 in transfer_set_status () at obexd/client/transfer.c:211
0x0003681e in transfer_set_status () at obexd/client/transfer.c:206
xfer_complete () at obexd/client/transfer.c:672
0x00022df6 in transfer_complete () at gobex/gobex-transfer.c:103
0x00022f44 in transfer_abort_response () at gobex/gobex-transfer.c:124
0x00020a0e in handle_response () at gobex/gobex.c:1128
0x00020dde in incoming_data () at gobex/gobex.c:1373

This commit introduces g_obex_drop_tx_queue(), which will be called if
a transfer error detected. After the tx queue is dropped, obex shuts
down gracefully.
2020-07-01 10:49:49 -07:00
..
gobex-apparam.c gobex: Make g_obex_apparam_encode NULL safe 2017-04-23 23:12:34 +03:00
gobex-apparam.h gobex: Fix GPL version reference 2013-02-15 16:25:29 +02:00
gobex-debug.h codingstyle: Change __FUNCTION__ to __func__ 2013-09-11 13:22:08 +03:00
gobex-defs.c gobex: Fix GPL version reference 2013-02-15 16:25:29 +02:00
gobex-defs.h gobex: Fix GPL version reference 2013-02-15 16:25:29 +02:00
gobex-header.c gobex: List all enum values in switch 2014-12-08 14:00:28 +01:00
gobex-header.h gobex: Fix includes for gobex.h header 2015-03-01 00:27:37 -08:00
gobex-packet.c gobex: Fix compiler warning from casting functions 2018-05-23 16:32:22 +02:00
gobex-packet.h gobex: Fix a compilation error for the compatibility with LLVM 2016-12-07 16:03:58 +02:00
gobex-transfer.c gobex: Fix segfault caused by interrupted transfer 2020-07-01 10:49:49 -07:00
gobex.c gobex: Fix segfault caused by interrupted transfer 2020-07-01 10:49:49 -07:00
gobex.h gobex: Fix segfault caused by interrupted transfer 2020-07-01 10:49:49 -07:00