Skip to content

gnutls: Fix crash when handshake_context is reset too late

Michael Catanzaro requested to merge mcatanzaro/#97-glib-2-60 into glib-2-60

If g_task_return_* returns immediately, via g_task_return_now(), then application code could start using the GTlsConnection again inside the call to g_task_return_now(), before handshake_thread_completed() has finished. That means a new handshake operation could get started before the previous handshake_context is cleared. It happens in practice when the server tries to rehandshake.

See #97 (closed), though this only fixes one instance of #97 (closed). There is another mystery condition where handshake_context fails to get unset that I have not yet found, so this issue is not completely solved.

Merge request reports