1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

(trunk libT) #4173 "crashing with r12315 in Debian" -- apply patch from comment:8 for testing in 2.30b2

This commit is contained in:
Jordan Lee 2011-04-09 14:36:33 +00:00
parent b4cdc74706
commit bad3cb53a3

View file

@ -1051,13 +1051,17 @@ evbuffer_add_uint64( struct evbuffer * outbuf, uint64_t addme_hll )
void
tr_peerIoReadBytesToBuf( tr_peerIo * io, struct evbuffer * inbuf, struct evbuffer * outbuf, size_t byteCount )
{
struct evbuffer * tmp;
const size_t old_length = evbuffer_get_length( outbuf );
assert( tr_isPeerIo( io ) );
assert( evbuffer_get_length( inbuf ) >= byteCount );
/* append it to outbuf */
evbuffer_remove_buffer( inbuf, outbuf, byteCount );
tmp = evbuffer_new( );
evbuffer_remove_buffer( inbuf, tmp, byteCount );
evbuffer_add_buffer( outbuf, tmp );
evbuffer_free( tmp );
/* decrypt if needed */
if( io->encryption_type == PEER_ENCRYPTION_RC4 ) {