From: Anatol Belski Date: Sat, 10 Sep 2016 00:44:21 +0000 (+0200) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.1.0RC2~36^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e539ea439b78a5f6ee41b2338fef377aa77632c1;p=php Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: Bug #73058 crypt broken when salt is 'too' long --- e539ea439b78a5f6ee41b2338fef377aa77632c1 diff --cc ext/standard/crypt.c index bca3bd1363,1b83d6e127..66b37eb79e --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@@ -202,16 -196,11 +202,8 @@@ PHPAPI zend_string *php_crypt(const cha } else if ( salt[0] == '$' && salt[1] == '2' && - salt[3] == '$' && - salt[4] >= '0' && salt[4] <= '3' && - salt[5] >= '0' && salt[5] <= '9' && - salt[6] == '$') { + salt[3] == '$') { char output[PHP_MAX_SALT_LEN + 1]; - int k = 7; - - while (isalnum(salt[k]) || '.' == salt[k] || '/' == salt[k]) { - k++; - } - if (k != salt_len) { - return NULL; - } memset(output, 0, PHP_MAX_SALT_LEN + 1);