Changeset 6050


Ignore:
Timestamp:
Jun 5, 2008, 4:25:22 PM (14 years ago)
Author:
charles
Message:

fix handshake.c crash reported by wereHamster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r5723 r6050  
    229229    /* torrent hash */
    230230    tr_peerIoReadBytes( handshake->io, inbuf, hash, sizeof(hash) );
    231     assert( tr_torrentExists( handshake->handle, hash ) );
    232231    assert( tr_peerIoHasTorrentHash( handshake->io ) );
    233     if( memcmp( hash, tr_peerIoGetTorrentHash(handshake->io), SHA_DIGEST_LENGTH ) ) {
     232    if( !tr_torrentExists( handshake->handle, hash )
     233        || memcmp( hash, tr_peerIoGetTorrentHash(handshake->io), SHA_DIGEST_LENGTH ) )
     234    {
    234235        dbgmsg( handshake, "peer returned the wrong hash. wtf?" );
    235236        return HANDSHAKE_BAD_TORRENT;
Note: See TracChangeset for help on using the changeset viewer.