summaryrefslogtreecommitdiff
path: root/ext/standard/crypt.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-24 12:22:44 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-24 12:22:44 +0200
commit4c4af2b2e1a88036cc85bc7a1265b2526d582569 (patch)
treea052608e975f491d84b51997d211261e77be84d6 /ext/standard/crypt.c
parent7d05bc863070c847614f712d53976efaf98b6541 (diff)
parent565baf05c07f3d1c2971a424fb03854c84b0eccc (diff)
downloadphp-git-4c4af2b2e1a88036cc85bc7a1265b2526d582569.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Handle *0 / *1 more consistently
Diffstat (limited to 'ext/standard/crypt.c')
-rw-r--r--ext/standard/crypt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 86cddc8e53..7adfbe5862 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -97,6 +97,11 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
{
char *crypt_res;
zend_string *result;
+
+ if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) {
+ return NULL;
+ }
+
/* Windows (win32/crypt) has a stripped down version of libxcrypt and
a CryptoApi md5_crypt implementation */
#if PHP_USE_PHP_CRYPT_R
@@ -158,8 +163,6 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1);
return result;
}
- } else if (salt[0] == '*' && (salt[1] == '0' || salt[1] == '1')) {
- return NULL;
} else {
/* DES Fallback */