/pidgin/main: 18f065e935eb: MXit: A copy of the data needs to be...

Andrew Victor andrew.victor at mxit.com
Wed Jan 16 04:39:53 EST 2013


Changeset: 18f065e935eb41ca0f349b71a005a83c341328f7
Author:	 Andrew Victor <andrew.victor at mxit.com>
Date:	 2013-01-16 11:38 +0200
Branch:	 release-2.x.y
URL: http://hg.pidgin.im/pidgin/main/rev/18f065e935eb

Description:

MXit: A copy of the data needs to be made here before handing it over to purple_imgstore_add_with_id().
Otherwise the imgstore will refer to an offset in the network receive buffer
which will be overwritten sometime later.

diffstat:

 libpurple/protocols/mxit/protocol.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/libpurple/protocols/mxit/protocol.c b/libpurple/protocols/mxit/protocol.c
--- a/libpurple/protocols/mxit/protocol.c
+++ b/libpurple/protocols/mxit/protocol.c
@@ -2166,7 +2166,7 @@ static void mxit_parse_cmd_media( struct
 					contact = get_mxit_invite_contact( session, chunk.mxitid );
 					if ( contact ) {
 						/* this is an invite (add image to the internal image store) */
-						contact->imgid = purple_imgstore_add_with_id( chunk.data, chunk.length, NULL );
+						contact->imgid = purple_imgstore_add_with_id( g_memdup( chunk.data, chunk.length ), chunk.length, NULL );
 						/* show the profile */
 						mxit_show_profile( session, chunk.mxitid, contact->profile );
 					}



More information about the Commits mailing list