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

(trunk libT) #4473 'underflow from malformed ssha1 can crash tr_ssha1_matches()' -- bah, fix oops in r12884.

This commit is contained in:
Jordan Lee 2011-09-16 22:55:58 +00:00
parent bb59768557
commit e2240e0831

View file

@ -382,7 +382,7 @@ tr_ssha1_matches( const char * source, const char * pass )
/* extract the salt */
if( sourcelen < 2*SHA_DIGEST_LENGTH-1 )
return false;
saltlen = sourcelen - SHA_DIGEST_LENGTH-1;
saltlen = sourcelen - 2*SHA_DIGEST_LENGTH-1;
salt = tr_malloc( saltlen );
memcpy( salt, source + 2*SHA_DIGEST_LENGTH+1, saltlen );