summaryrefslogtreecommitdiff
path: root/ext/standard/crypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/crypt.c')
-rw-r--r--ext/standard/crypt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 66b37eb79e..bca3bd1363 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -204,6 +204,14 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
salt[1] == '2' &&
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);