This commit is contained in:
Nikita Popov 2016-03-25 20:18:46 +01:00
parent c4681ec8e1
commit 54da966883
2 changed files with 14 additions and 7 deletions

2
NEWS
View File

@ -30,6 +30,8 @@ PHP NEWS
- Standard:
. Fixed bug #71840 (Unserialize accepts wrongly data). (Ryat, Laruence)
. Fixed bug #67512 (php_crypt() crashes if crypt_r() does not exist or
_REENTRANT is not defined). (Nikita)
31 Marc 2016, PHP 5.6.20

View File

@ -239,15 +239,20 @@ PHPAPI int php_crypt(const char *password, const int pass_len, const char *salt,
# error Data struct used by crypt_r() is unknown. Please report.
# endif
crypt_res = crypt_r(password, salt, &buffer);
}
# elif defined(HAVE_CRYPT)
crypt_res = crypt(password, salt);
# else
# error No crypt() implementation
# endif
#endif
if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
return FAILURE;
} else {
*result = estrdup(crypt_res);
return SUCCESS;
}
}
# endif
#endif
}
/* }}} */