diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch')
-rw-r--r-- | net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch new file mode 100644 index 000000000000..d6c43ae9d66f --- /dev/null +++ b/net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch @@ -0,0 +1,137 @@ +From ff113220df9073c3e6078487e87b6a7b86e2d952 Mon Sep 17 00:00:00 2001 +From: Mikael Hallendal <micke@imendio.com> +Date: Sun, 30 Nov 2008 09:27:21 +0100 +Subject: [PATCH] Don't free connection internals before it's closed. [#34] + +When the connection freed up internal states (in this case the handler +lists) before closing itself it segfaulted when trying to unregister the +SASL handlers. + +Reported by Julien Puydt. +--- + loudmouth/lm-connection.c | 30 +++++++++++++++++------------- + loudmouth/lm-sasl.c | 18 +++++++++--------- + 2 files changed, 26 insertions(+), 22 deletions(-) + +diff --git a/loudmouth/lm-connection.c b/loudmouth/lm-connection.c +index 915c0ad..dda2978 100644 +--- a/loudmouth/lm-connection.c ++++ b/loudmouth/lm-connection.c +@@ -191,13 +191,21 @@ connection_free (LmConnection *connection) + { + int i; + ++ /* This needs to be run before starting to free internal states. ++ * It used to be run after the handlers where freed which lead to a crash ++ * when the connection was freed prior to running lm_connection_close. ++ */ ++ if (connection->state >= LM_CONNECTION_STATE_OPENING) { ++ connection_do_close (connection); ++ } ++ + g_free (connection->server); + g_free (connection->jid); + g_free (connection->effective_jid); + g_free (connection->stream_id); + g_free (connection->resource); + +- if (connection->sasl) { ++ if (connection->sasl) { + lm_sasl_free (connection->sasl); + } + +@@ -218,13 +226,9 @@ connection_free (LmConnection *connection) + + g_slist_free (connection->handlers[i]); + } +- + g_hash_table_destroy (connection->id_handlers); +- if (connection->state >= LM_CONNECTION_STATE_OPENING) { +- connection_do_close (connection); +- } + +- if (connection->open_cb) { ++ if (connection->open_cb) { + _lm_utils_free_callback (connection->open_cb); + } + +@@ -2030,11 +2034,11 @@ lm_connection_unregister_message_handler (LmConnection *connection, + g_return_if_fail (handler != NULL); + g_return_if_fail (type != LM_MESSAGE_TYPE_UNKNOWN); + +- for (l = connection->handlers[type]; l; l = l->next) { +- HandlerData *hd = (HandlerData *) l->data; +- ++ for (l = connection->handlers[type]; l; l = l->next) { ++ HandlerData *hd = (HandlerData *) l->data; ++ + if (handler == hd->handler) { +- connection->handlers[type] = g_slist_remove_link (connection->handlers[type], l); ++ connection->handlers[type] = g_slist_remove_link (connection->handlers[type], l); + g_slist_free (l); + lm_message_handler_unref (hd->handler); + g_free (hd); +@@ -2140,7 +2144,7 @@ lm_connection_ref (LmConnection *connection) + g_return_val_if_fail (connection != NULL, NULL); + + connection->ref_count++; +- ++ + return connection; + } + +@@ -2157,8 +2161,8 @@ lm_connection_unref (LmConnection *connection) + g_return_if_fail (connection != NULL); + + connection->ref_count--; +- ++ + if (connection->ref_count == 0) { +- connection_free (connection); ++ connection_free (connection); + } + } +diff --git a/loudmouth/lm-sasl.c b/loudmouth/lm-sasl.c +index 42ee0e1..e6a72f5 100644 +--- a/loudmouth/lm-sasl.c ++++ b/loudmouth/lm-sasl.c +@@ -807,27 +807,27 @@ lm_sasl_free (LmSASL *sasl) + g_free (sasl->server); + + if (sasl->features_cb) { +- lm_connection_unregister_message_handler (sasl->connection, +- sasl->features_cb, +- LM_MESSAGE_TYPE_STREAM_FEATURES); ++ lm_connection_unregister_message_handler (sasl->connection, ++ sasl->features_cb, ++ LM_MESSAGE_TYPE_STREAM_FEATURES); + } + + if (sasl->challenge_cb) { + lm_connection_unregister_message_handler (sasl->connection, +- sasl->challenge_cb, +- LM_MESSAGE_TYPE_CHALLENGE); ++ sasl->challenge_cb, ++ LM_MESSAGE_TYPE_CHALLENGE); + } + + if (sasl->success_cb) { + lm_connection_unregister_message_handler (sasl->connection, +- sasl->success_cb, +- LM_MESSAGE_TYPE_SUCCESS); ++ sasl->success_cb, ++ LM_MESSAGE_TYPE_SUCCESS); + } + + if (sasl->failure_cb) { + lm_connection_unregister_message_handler (sasl->connection, +- sasl->failure_cb, +- LM_MESSAGE_TYPE_FAILURE); ++ sasl->failure_cb, ++ LM_MESSAGE_TYPE_FAILURE); + } + + g_free (sasl); +-- +1.7.7.1 + |