From: Ilia Alshanetsky Date: Fri, 11 Apr 2003 02:40:21 +0000 (+0000) Subject: Fixed integer overflow inside mhash_keygen_s2k(). X-Git-Tag: RELEASE_0_5~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fbd27252d27aa1225019eabd4e27b1df49241cd;p=php Fixed integer overflow inside mhash_keygen_s2k(). --- diff --git a/ext/mhash/mhash.c b/ext/mhash/mhash.c index 12b135b5e4..7be388bd16 100644 --- a/ext/mhash/mhash.c +++ b/ext/mhash/mhash.c @@ -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);