# HG changeset patch # User Mark Doliner # Date 1265617572 0 # Node ID f3d2a46a5ea8afc0990112287d4cfa153a8f6642 # Parent d22b9e73c929fa12f37bd6f831b8d474601d618a Attempt to simplify and clean diff -r d22b9e73c929 -r f3d2a46a5ea8 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Mon Feb 08 08:18:20 2010 +0000 +++ b/libpurple/protocols/msn/slplink.c Mon Feb 08 08:26:12 2010 +0000 @@ -497,7 +497,6 @@ const char *data; guint64 offset; gsize len; - PurpleXfer *xfer = NULL; if (purple_debug_is_verbose()) msn_slpmsg_show(msg); @@ -508,8 +507,11 @@ if (msg->msnslp_header.total_size < msg->msnslp_header.length) { - purple_debug_error("msn", "This can't be good\n"); - g_return_if_reached(); + /* We seem to have received a bad header */ + purple_debug_warning("msn", "Total size listed in SLP binary header " + "was less than length of this particular message. This " + "should not happen. Dropping message.\n"); + return; } data = msn_message_get_bin_data(msg, &len); @@ -534,7 +536,7 @@ if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000020 || slpmsg->flags == 0x1000030) { - xfer = slpmsg->slpcall->xfer; + PurpleXfer *xfer = slpmsg->slpcall->xfer; if (xfer != NULL) { slpmsg->ft = TRUE; @@ -578,10 +580,9 @@ if (slpmsg->ft) { - xfer = slpmsg->slpcall->xfer; slpmsg->slpcall->u.incoming_data = g_byte_array_append(slpmsg->slpcall->u.incoming_data, (const guchar *)data, len); - purple_xfer_prpl_ready(xfer); + purple_xfer_prpl_ready(slpmsg->slpcall->xfer); } else if (slpmsg->size && slpmsg->buffer) {