mirror of
https://github.com/transmission/transmission
synced 2025-03-12 07:03:44 +00:00
Fix erratic `(int)EVBUFFER_LENGTH( inbuf ) >= byteCount' error
This commit is contained in:
parent
cdabb1c0b1
commit
f4901211ca
1 changed files with 5 additions and 1 deletions
|
@ -797,7 +797,11 @@ readCryptoProvide( tr_handshake * handshake, struct evbuffer * inbuf )
|
||||||
uint8_t obfuscatedTorrentHash[SHA_DIGEST_LENGTH];
|
uint8_t obfuscatedTorrentHash[SHA_DIGEST_LENGTH];
|
||||||
uint16_t padc_len = 0;
|
uint16_t padc_len = 0;
|
||||||
uint32_t crypto_provide = 0;
|
uint32_t crypto_provide = 0;
|
||||||
const size_t needlen = SHA_DIGEST_LENGTH + VC_LENGTH + sizeof(crypto_provide) + sizeof(padc_len);
|
const size_t needlen = SHA_DIGEST_LENGTH /* HASH('req1',s) */
|
||||||
|
+ SHA_DIGEST_LENGTH /* HASH('req2', SKEY) xor HASH('req3', S) */
|
||||||
|
+ VC_LENGTH
|
||||||
|
+ sizeof(crypto_provide)
|
||||||
|
+ sizeof(padc_len);
|
||||||
tr_torrent * tor = NULL;
|
tr_torrent * tor = NULL;
|
||||||
|
|
||||||
if( EVBUFFER_LENGTH(inbuf) < needlen )
|
if( EVBUFFER_LENGTH(inbuf) < needlen )
|
||||||
|
|
Loading…
Add table
Reference in a new issue