# HG changeset patch # User Elliott Sales de Andrade # Date 1299733668 0 # Node ID eeca86db288bac411acf9e98d0e28678742dd3b1 # Parent 8cf9270acf4cadc598ba22f198c38677cc8efac2 Oops, I forgot to move the size check to the new location. diff -r 8cf9270acf4c -r eeca86db288b libpurple/protocols/msn/p2p.c --- a/libpurple/protocols/msn/p2p.c Thu Mar 10 05:00:17 2011 +0000 +++ b/libpurple/protocols/msn/p2p.c Thu Mar 10 05:07:48 2011 +0000 @@ -90,12 +90,18 @@ size_t msn_p2p_header_from_wire(MsnP2PInfo *info, const char *wire, size_t max_len) { - size_t len; + size_t len = 0; switch (info->version) { case MSN_P2P_VERSION_ONE: { MsnP2PHeader *header = &info->header.v1; + if (max_len < P2P_PACKET_HEADER_SIZE) { + /* Invalid packet length */ + len = 0; + break; + } + header->session_id = msn_pop32le(wire); header->id = msn_pop32le(wire); header->offset = msn_pop64le(wire);