telepathy-gabble: Don't crash on <challenge> after closing auth channel

Will Thompson wjt at kemper.freedesktop.org
Thu Dec 6 09:56:45 PST 2012


Module: telepathy-gabble
Branch: master
Commit: be0be56f6c097f1a54c64421303dfeb3b930d7a6
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=be0be56f6c097f1a54c64421303dfeb3b930d7a6

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Tue Nov 20 16:06:17 2012 +0000

Don't crash on <challenge> after closing auth channel

https://bugs.freedesktop.org/show_bug.cgi?id=52146

---

 src/auth-manager.c          |    6 +++++-
 tests/twisted/sasl/abort.py |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/auth-manager.c b/src/auth-manager.c
index 46400ca..663925b 100644
--- a/src/auth-manager.c
+++ b/src/auth-manager.c
@@ -445,7 +445,11 @@ gabble_auth_manager_challenge_async (WockyAuthRegistry *registry,
         }
       else
         {
-          g_assert_not_reached ();
+          g_assert (self->priv->error != NULL);
+
+          g_simple_async_result_set_from_error (result, self->priv->error->wocky_error);
+          g_simple_async_result_complete_in_idle (result);
+          g_object_unref (result);
         }
     }
 }
diff --git a/tests/twisted/sasl/abort.py b/tests/twisted/sasl/abort.py
index fc54ead..908e166 100644
--- a/tests/twisted/sasl/abort.py
+++ b/tests/twisted/sasl/abort.py
@@ -171,7 +171,7 @@ if __name__ == '__main__':
     exec_test_(test_abort_mid)
     exec_test_(test_disconnect_mid)
     exec_test_(test_abort_connected)
-    # exec_test_(test_close_then_challenge)
+    exec_test_(test_close_then_challenge)
     # exec_test_(test_close_then_success)
     exec_test_(test_close_then_failure)
     exec_test_(test_abort_then_challenge)



More information about the telepathy-commits mailing list