mirror of
https://github.com/transmission/transmission.git
synced 2026-04-17 23:54:19 +01:00
(trunk libT) #4473 'underflow from malformed ssha1 can crash tr_ssha1_matches()' -- bah, fix oops in r12884.
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user