Fixed integer overflow inside mhash_keygen_s2k().

This commit is contained in:
Ilia Alshanetsky 2003-04-11 02:40:21 +00:00
parent c013f78274
commit 4fbd27252d

View File

@ -203,6 +203,10 @@ PHP_FUNCTION(mhash_keygen_s2k)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lssl", &hash, &password, &password_len, &in_salt, &salt_len, &bytes) == FAILURE) {
WRONG_PARAM_COUNT;
}
if (bytes <= 0){
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the byte parameter must be greater then 0");
RETURN_FALSE;
}
salt_len = MIN(salt_len, SALT_SIZE);