Mercurial > pidgin
diff libpurple/protocols/msn/msg.c @ 30846:e0c374ad8fd3
Set the correct length of the data before calling the function to process it.
author | masca@cpw.pidgin.im |
---|---|
date | Tue, 06 Jul 2010 18:56:58 +0000 |
parents | 6e7a0e87d589 |
children | 74c4aa38adfc |
line wrap: on
line diff
--- a/libpurple/protocols/msn/msg.c Tue Jul 06 18:51:44 2010 +0000 +++ b/libpurple/protocols/msn/msg.c Tue Jul 06 18:56:58 2010 +0000 @@ -942,8 +942,12 @@ data = msn_message_get_bin_data(msg, &len); - if (msg->part) - msn_slplink_process_msg(slplink, msg->part->header, data, len); + if (msg->part) { + len -= P2P_PACKET_HEADER_SIZE; + len -= P2P_PACKET_FOOTER_SIZE; + + msn_slplink_process_msg(slplink, msg->part->header, data+P2P_PACKET_HEADER_SIZE, len); + } else /* This should never happen. */ purple_debug_fatal("msn", "P2P message without a Part.\n"); }