(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
1 changed files with 1 additions and 1 deletions

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 );