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

Andrew Victor andrew.victor at mxit.com
Mon Jun 20 20:09:58 EDT 2016


Changeset: 648f667a679cf13ba957e6481edafa7e210faaf3
Author:	 Andrew Victor <andrew.victor at mxit.com>
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 );
 



More information about the Commits mailing list