Skip to content

Commit 4c4af2b

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Handle *0 / *1 more consistently
2 parents 7d05bc8 + 565baf0 commit 4c4af2b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/standard/crypt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
9797
{
9898
char *crypt_res;
9999
zend_string *result;
100+
101+
if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) {
102+
return NULL;
103+
}
104+
100105
/* Windows (win32/crypt) has a stripped down version of libxcrypt and
101106
a CryptoApi md5_crypt implementation */
102107
#if PHP_USE_PHP_CRYPT_R
@@ -158,8 +163,6 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
158163
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1);
159164
return result;
160165
}
161-
} else if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) {
162-
return NULL;
163166
} else {
164167
/* DES Fallback */
165168

0 commit comments

Comments
 (0)