* This used to be done using tlvchains. For performance reasons,
* I've changed it to process the TLVs in-place. This avoids lots
* of per-IM memory allocations.
*/
while(byte_stream_bytes_left(bs)>=4)
{
type=byte_stream_get16(bs);
length=byte_stream_get16(bs);
if(length>byte_stream_bytes_left(bs))
{
purple_debug_misc("oscar","Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n",userinfo->bn);