# HG changeset patch # User Paul Aurich # Date 1255050971 0 # Node ID 1e5b69e676770a41faae8429ef79d277460a0be3 # Parent 24702a4affaa97d77e7a93fee0273c0957b33959 Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw. Should Fixes #10222 diff -r 24702a4affaa -r 1e5b69e67677 libpurple/plugins/perl/common/Prpl.xs --- a/libpurple/plugins/perl/common/Prpl.xs Thu Oct 08 04:02:26 2009 +0000 +++ b/libpurple/plugins/perl/common/Prpl.xs Fri Oct 09 01:16:11 2009 +0000 @@ -62,11 +62,15 @@ PREINIT: PurplePluginProtocolInfo *prpl_info; CODE: - prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && prpl_info->send_raw != NULL) { - RETVAL = prpl_info->send_raw(gc, str, strlen(str)); - } else { + if (!gc) RETVAL = 0; + else { + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); + if (prpl_info && prpl_info->send_raw != NULL) { + RETVAL = prpl_info->send_raw(gc, str, strlen(str)); + } else { + RETVAL = 0; + } } OUTPUT: RETVAL