--- a/libpurple/protocols/mxit/protocol.c Thu Apr 03 04:23:35 2014 +0200 +++ b/libpurple/protocols/mxit/protocol.c Thu Apr 03 04:33:49 2014 +0200 @@ -2093,11 +2093,12 @@ */ static int get_chunk_len( const char* chunkdata ) { - int* sizeptr; - - sizeptr = (int*) &chunkdata[1]; /* we skip the first byte (type field) */ - - return ntohl( *sizeptr ); + guint32 size_val; + + /* we skip the first byte (type field) */ + memcpy(&size_val, &chunkdata[1], sizeof(size_val)); + + return ntohl(size_val); }