com php-src: Merge branch 'PHP-5.6' into PHP-7.0: NEWS ext/standard/crypt.c
| From: | Nikita Popov | Date: | Fri, 25 Mar 2016 19:23:04 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6' into PHP-7.0: NEWS ext/standard/crypt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91480@lists.php.net to get a copy of this message | ||
Commit: bd90f5507f63b2b624c9ad04668c67cc3d1b8952
Author: Nikita Popov <nikic@php.net> Fri, 25 Mar 2016 20:23:04 +0100
Parents: 1929fc9b16c836c1449dee3fd3570031ff8dcba1 54da966883bacf28808e26eeda48fe38e21b118e
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bd90f5507f63b2b624c9ad04668c67cc3d1b8952
Log:
Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
ext/standard/crypt.c
Changed paths:
MM NEWS
MM ext/standard/crypt.c
Diff:
diff --cc NEWS
index ab38c06,1f2a906..6482d38
--- a/NEWS
+++ b/NEWS
@@@ -34,22 -25,15 +34,24 @@@ PH
call constructor). (Anatol)
- SPL:
+ . Fixed bug #71838 (Deserializing serialized SPLObjectStorage-Object can't
+ access properties in PHP). (Nikita)
+ . Fixed bug #52339 (SPL autoloader breaks class_exists()). (Nikita)
. Fixed bug #67582 (Cloned SplObjectStorage with overwritten getHash fails
offsetExists()). (Nikita)
+ . Fixed bug #71735 (Double-free in SplDoublyLinkedList::offsetSet). (Stas)
- Standard:
+ . Fixed bug #71891 (header_register_callback() and
+ register_shutdown_function()). (Laruence)
+ . Fixed bug #71884 (Null pointer deref (segfault) in
+ stream_context_get_default). (Laruence)
+ . Fixed bug #71837 (Wrong arrays behaviour). (Laruence)
. 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
+31 Mar 2016 PHP 7.0.5
- CLI Server:
. Fixed bug #69953 (Support MKCALENDAR request method). (Christoph)
diff --cc ext/standard/crypt.c
index 6bc90e2,1b83d6e..66b37eb
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@@ -246,6 -228,6 +246,13 @@@ PHPAPI zend_string *php_crypt(const cha
}
#else
++ if (salt[0] != '$' && salt[0] != '_' &&
(!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARACTER(salt[1]))) {
++ if (!quiet) {
++ /* error consistently about invalid DES fallbacks */
++ php_error_docref(NULL, E_DEPRECATED, DES_INVALID_SALT_ERROR);
++ }
++ }
++
# if defined(HAVE_CRYPT_R) && (defined(_REENTRANT) || defined(_THREAD_SAFE))
{
# if defined(CRYPT_R_STRUCT_CRYPT_DATA)
@@@ -254,24 -236,23 +261,23 @@@
# 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
- if (salt[0] != '$' && salt[0] != '_' &&
(!IS_VALID_SALT_CHARACTER(salt[0]) || !IS_VALID_SALT_CHARACTER(salt[1]))) {
- if (!quiet) {
- /* error consistently about invalid DES fallbacks */
- php_error_docref(NULL, E_DEPRECATED, DES_INVALID_SALT_ERROR);
- }
- }
crypt_res = crypt_r(password, salt, &buffer);
- if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
- return NULL;
- } else {
- result = zend_string_init(crypt_res, strlen(crypt_res), 0);
- return result;
- }
}
+ # 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;
++ return NULL;
+ } else {
- *result = estrdup(crypt_res);
- return SUCCESS;
++ result = zend_string_init(crypt_res, strlen(crypt_res), 0);
++ return result;
+ }
}
/* }}} */