Ignore:
Timestamp:
Apr 13, 2008, 2:29:11 PM (14 years ago)
Author:
charles
Message:

#872: crash in bitfield code when loading resume files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r5597 r5606  
    238238}
    239239
    240 void
     240tr_errno
    241241tr_cpBlockBitfieldSet( tr_completion * cp, tr_bitfield * bitfield )
    242242{
    243243    tr_block_index_t i;
    244244
    245     assert( cp != NULL );
    246     assert( bitfield != NULL );
     245    if( !cp || !bitfield || ( bitfield->len != cp->blockBitfield->len ) )
     246        return TR_ERROR_ASSERT;
    247247
    248248    tr_cpReset( cp );
    249 
    250249    for( i=0; i < cp->tor->blockCount; ++i )
    251250        if( tr_bitfieldHas( bitfield, i ) )
    252251            tr_cpBlockAdd( cp, i );
     252
     253    return 0;
    253254}
    254255
Note: See TracChangeset for help on using the changeset viewer.