This reverts commit 3e62aae.
… to dot files).
… 2093 for successful XFAIL)
Use salt_len_in instead of strlen(salt) or PHP_MAX_SALT_LEN, otherwise too much memory will be allocated. sha512 has a 86 character checksum, not 43. That probably was a copy&paste from the sha256 code which indeed has 43. The allocation also was using sizeof(char *), thus allocating 4 or 8 times as much memory as necessary. The sizeof(char *) was removed in the 5.4 branch in b7a92c9 but forgotten on 5.3. The memset 0 call was using PHP_MAX_SALT_LEN which can be smaller than the output buffer and thus not zeroing out everything. Use the size of the output buffer (needed) instead.
Fixed a memory allocation bug in crypt() SHA256/512 that can cause segmentation faults when passed in salts with a null byte early.
* PHP-5.3: Fix #62432 ReflectionMethod random corrupt memory on high concurrent Conflicts: ext/date/php_date.c ext/fileinfo/fileinfo.c ext/pdo/pdo_dbh.c ext/pdo/pdo_stmt.c ext/reflection/php_reflection.c ext/spl/spl_array.c ext/spl/spl_directory.c ext/spl/spl_dllist.c ext/spl/spl_fixedarray.c ext/spl/spl_heap.c ext/spl/spl_iterators.c ext/spl/spl_observer.c ext/sqlite/sqlite.c ext/sqlite3/sqlite3.c ext/tidy/tidy.c ext/xmlreader/php_xmlreader.c ext/xmlwriter/php_xmlwriter.c ext/xsl/php_xsl.c ext/zip/php_zip.c
This fixes the same issue in multiple extensions. This isn't needed in later branches as 5.4 introduced object_properties_init()
json_encode() no longer throws warnings. Instead only the error code for json_last_error() is set. As it is hard to debug the error from just an error code an optional $as_string parameter was added to json_last_error(), which returns an error message instead of an error code.