1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

(trunk libT) fix off-by-one in tr_ssha1() reported by lightix @ http://forum.transmissionbt.com/viewtopic.php?f=2&t=7684#p37556

This commit is contained in:
Charles Kerr 2009-05-28 13:02:03 +00:00
parent 89b37faa2a
commit cd36431b0c

View file

@ -375,7 +375,7 @@ tr_ssha1( const void * plaintext )
uint8_t sha[SHA_DIGEST_LENGTH];
char buf[2*SHA_DIGEST_LENGTH + saltval_len + 2];
for( i=0; i<=saltval_len; ++i )
for( i=0; i<saltval_len; ++i )
salt[i] = salter[ tr_cryptoRandInt( salter_len ) ];
tr_sha1( sha, plaintext, strlen( plaintext ), salt, saltval_len, NULL );