qulogic/pidgin

Add a check to make sure the file can have a chunk
release-2.x.y
2016-06-03, Andrew Victor
648f667a679c
Parents 1c5197a66760
Children bb5701f8ae79
Add a check to make sure the file can have a chunk
--- a/libpurple/protocols/mxit/chunk.c Fri Jun 03 12:39:32 2016 -0500
+++ b/libpurple/protocols/mxit/chunk.c Fri Jun 03 12:40:25 2016 -0500
@@ -507,6 +507,10 @@
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 );