Skip to content

Instantly share code, notes, and snippets.

@pete
Created May 9, 2009 01:16
Show Gist options
  • Save pete/109086 to your computer and use it in GitHub Desktop.
Save pete/109086 to your computer and use it in GitHub Desktop.
diff -Naur pidgin-2.5.5/libpurple/connection.c pidgin-2.5.5-pete/libpurple/connection.c
--- pidgin-2.5.5/libpurple/connection.c 2009-01-24 07:13:25.000000000 -0800
+++ pidgin-2.5.5-pete/libpurple/connection.c 2009-05-08 16:44:23.000000000 -0700
@@ -512,16 +512,23 @@
void
purple_connection_error(PurpleConnection *gc, const char *text)
{
/* prpls that have not been updated to use disconnection reasons will
* be setting wants_to_die before calling this function, so choose
* PURPLE_CONNECTION_ERROR_OTHER_ERROR (which is fatal) if it's true,
* and PURPLE_CONNECTION_ERROR_NETWORK_ERROR (which isn't) if not. See
* the documentation in connection.h.
*/
- PurpleConnectionError reason = gc->wants_to_die
- ? PURPLE_CONNECTION_ERROR_OTHER_ERROR
- : PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
- purple_connection_error_reason (gc, reason, text);
+ /* The real bug is NULL being passed here, not this function's handling
+ of it. */
+ if(gc) {
+ PurpleConnectionError reason = gc->wants_to_die
+ ? PURPLE_CONNECTION_ERROR_OTHER_ERROR
+ : PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
+ purple_connection_error_reason (gc, reason, text);
+ }
}
void
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment