--- a/libpurple/protocols/mxit/protocol.c Sun May 15 05:41:39 2016 -0300 +++ b/libpurple/protocols/mxit/protocol.c Fri Jun 03 11:50:10 2016 -0500 @@ -1819,6 +1819,12 @@ /* set the count for attributes */ count = atoi( records[0]->fields[1]->data ); + /* ensure the packet has the correct number of fields */ + if ( records[0]->fcount < ( 2 + ( count * 3 ) ) ) { + purple_debug_error( MXIT_PLUGIN_ID, "Insufficient number of fields in extprofile response. fields=%i records=%i", records[0]->fcount, count ); + return; + } + for ( i = 0; i < count; i++ ) { char* fname; char* fvalue;