/pidgin/main: 648f667a679c: Add a check to make sure the file ca...

Andrew Victor <[email protected]> Mon, 20 Jun 2016 20:09:58 -0400
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 648f667a679cf13ba957e6481edafa7e210faaf3
Author:	 Andrew Victor <[email protected]>
Date:	 2016-06-03 12:40 -0500
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/648f667a679c

Description:

Add a check to make sure the file can have a chunk

diffstat:

 libpurple/protocols/mxit/chunk.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff --git a/libpurple/protocols/mxit/chunk.c b/libpurple/protocols/mxit/chunk.c
--- a/libpurple/protocols/mxit/chunk.c
+++ b/libpurple/protocols/mxit/chunk.c
@@ -507,6 +507,10 @@ gboolean mxit_chunk_parse_get( char* chu
 
 	memset( getfile, 0, sizeof( struct getfile_chunk ) );
 
+	/* ensure that the chunk size is atleast the minimum size for a "get file" chunk */
+	if ( datalen < 20 )
+		return FALSE;
+
 	/* id [8 bytes] */
 	pos += get_data( &chunkdata[pos], getfile->fileid, 8 );
 

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits