- 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
# elif defined(CRYPT_R_CRYPTD)
CRYPTD buffer;
# else
-# error Data struct used by crypt_r() is unknown. Please report.
+# error Data struct used by crypt_r() is unknown. Please report.
# endif
crypt_res = crypt_r(password, salt, &buffer);
- if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
- return FAILURE;
- } else {
- *result = estrdup(crypt_res);
- return SUCCESS;
- }
}
+# 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;
+ }
}
/* }}} */