Changeset 3000


Ignore:
Timestamp:
Sep 9, 2007, 4:57:15 PM (14 years ago)
Author:
charles
Message:

(encryption) fix loooong-standing off-by-one memory allocation bug in the bitfield code

Location:
branches/encryption/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/encryption/libtransmission/peer-mgr.c

    r2995 r3000  
    620620
    621621void
    622 tr_peerMgrStopTorrent( tr_peerMgr     * manager UNUSED,
    623                        const uint8_t  * torrentHash UNUSED )
    624 {
    625     //fprintf( stderr, "FIXME\n" );
     622tr_peerMgrStopTorrent( tr_peerMgr     * manager,
     623                       const uint8_t  * torrentHash)
     624{
     625    Torrent * t = getExistingTorrent( manager, torrentHash );
     626    freeTorrent( manager, t );
    626627}
    627628
  • branches/encryption/libtransmission/utils.c

    r2987 r3000  
    672672        return NULL;
    673673
    674     ret->len = ( bitcount + 7u ) / 8u;
     674    ret->len = bitcount/8u + 1;
    675675    ret->bits = calloc( ret->len, 1 );
    676676    if( NULL == ret->bits ) {
Note: See TracChangeset for help on using the changeset viewer.