Skip to content

Fix possible crashes when connectivity is lost

Waqar Ahmed requested to merge work/fix-crashes into 1.6

Fixes crashes such as:

==404298==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b000f2add8 at pc 0x7f056028dfe7 bp 0x7fff849c21b0 sp 0x7fff849c21a8
READ of size 8 at 0x60b000f2add8 thread T0
    #0 0x7f056028dfe6 in RocketChatRestApi::RestApiAbstractJob::addLoggerWarning(QByteArray const&) restapiabstractjob.cpp:153:9
    #1 0x7f056033b843 in RocketChatRestApi::GetChannelRolesJob::slotGetChannelRolesFinished() getchannelrolesjob.cpp:78:13
    #2 0x7f056033bfa4 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, .... qobjectdefs_impl.h:152:13

and

==402814==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c00089c0d8 at pc 0x7f6d02437de7 bp 0x7ffe8b8a0cb0 sp 0x7ffe8b8a0ca8
READ of size 8 at 0x60c00089c0d8 thread T0
    #0 0x7f6d02437de6 in RocketChatRestApi::RestApiAbstractJob::addLoggerWarning(QByteArray const&) restapiabstractjob.cpp:153:9
    #1 0x7f6d024f6024 in RocketChatRestApi::ChannelMembersJob::slotChannelMembersFinished() channelmembersjob.cpp:52:13
    #2 0x7f6d024f7b74 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, .... qobjectdefs_impl.h:152:13
    ...

There's probably more

Merge request reports