Compare commits

...
Author SHA1 Message Date
Sara Golemon a6bc51a449 Update versions for PHP 7.2.9 2018-08-14 14:01:54 +00:00
Sara Golemon 78c931a55f Update NEWS for PHP 7.2.9 2018-08-14 14:01:53 +00:00
Sara Golemon 9855bd6414 Stitch 7.2.9RC1 as 7.2.9 2018-08-14 10:01:13 -04:00
Sara Golemon 161b672b88 Update NEWS for 7.2.9 2018-07-31 13:02:06 +00:00
Sara Golemon ee87db285f Update NEWS for PHP 7.2.9RC1 2018-07-31 12:32:44 +00:00
Anatol Belski 095a30e11b Update NEWS [ci skip] 2018-07-30 19:43:23 +02:00
Anatol Belski e111ef5626 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS [ci skip]
2018-07-30 19:42:45 +02:00
Anatol Belski 2870178720 Update NEWS [ci skip] 2018-07-30 19:42:10 +02:00
Anatol Belski d207d6a57f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option
2018-07-30 18:28:53 +02:00
Anatol Belski cc69950b15 Fixed bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option 2018-07-30 18:27:59 +02:00
Christoph M. Becker ce66492a13 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
2018-07-26 13:26:58 +02:00
Christoph M. Becker ed7e3bc70a Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
We need to ensure that a zval IS_DOUBLE before we access it as such.
In this case we apply common type juggling to do so.
2018-07-26 13:15:19 +02:00
Christoph M. Becker a96ca13963 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76643: Segmentation fault when using `output_add_rewrite_var`
2018-07-24 12:28:22 +02:00
Christoph M. Becker 40bd84d3e3 Fix #76643: Segmentation fault when using output_add_rewrite_var
We have to check whether _SERVER is actually an array before we're
going to use it as such.
2018-07-24 12:20:13 +02:00
Xinchen Hui 033dac7a6f Update NEWs 2018-07-24 11:35:43 +08:00
Xinchen Hui 2a181b5ea0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result)
2018-07-24 11:35:22 +08:00
Xinchen Hui 38d97557da Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result) 2018-07-24 11:34:57 +08:00
Xinchen Hui c20a97df6d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed pefree_size (efree_size will be expaned to do {} while () form)
2018-07-23 15:48:52 +08:00
Xinchen Hui 2139c2c2de Fixed pefree_size (efree_size will be expaned to do {} while () form) 2018-07-23 15:48:14 +08:00
Christoph M. Becker 33eb30274f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #52974: jewish.c: compile error under Windows with GBK charset
2018-07-22 17:59:38 +02:00
Christoph M. Becker 99fdf5916e Fix #52974: jewish.c: compile error under Windows with GBK charset
jewish.c includes ISO-8859-8 encoded Hebrew Hebrew month names, which
may cause compile errors, and is generally confusing.  We replace the
literal month names with appropriate escape sequences.
2018-07-22 17:42:10 +02:00
Anatol Belski 2073e96ec5 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update binary SDK version for AppVeyor
2018-07-19 18:37:38 +02:00
Anatol Belski 9e54d9d692 Update binary SDK version for AppVeyor 2018-07-19 18:35:54 +02:00
Ferenc Kovacs ca618a4f10 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-19 16:57:50 +02:00
Ferenc Kovacs 0510b47894 Merge branch 'PHP-7.0' into PHP-7.1 2018-07-19 16:57:18 +02:00
Ferenc Kovacs e5b27b9916 Merge branch 'PHP-5.6' into PHP-7.0 2018-07-19 16:56:32 +02:00
Ferenc Kovacs 1ba3314335 5.6.38 will be next 2018-07-19 16:54:58 +02:00
Anatol Belski b494d94f16 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  7.0.32 next
2018-07-17 12:37:51 +02:00
Anatol Belski dfc2e3a2ac Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  7.0.32 next
2018-07-17 12:37:02 +02:00
Anatol Belski d011da9d1a 7.0.32 next 2018-07-17 12:36:13 +02:00
Anatol Belski c4106d4569 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-07-17 11:59:17 +02:00
Anatol Belski 1127163996 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] Update NEWS
2018-07-17 11:58:43 +02:00
Anatol Belski b52c4fcbcd [ci skip] Update NEWS 2018-07-17 11:58:00 +02:00
Remi Collet e069b0beba NEWS 2018-07-17 06:07:28 +02:00
Stanislav Malyshev ebd5f56442 Fix test 2018-07-16 18:52:01 -07:00
Stanislav Malyshev a536d6d61b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:53:57 -07:00
Stanislav Malyshev 4e92cd172a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:52:36 -07:00
Stanislav Malyshev bddf8140e4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 15:13:13 -07:00
Anatol Belski f151e048ed Fixed bug #76459 windows linkinfo lacks openbasedir check 2018-07-16 15:11:56 -07:00
Stanislav Malyshev b73a108543 Add NEWS 2018-07-16 14:26:31 -07:00
Anatol Belski 289cb0f77c Fixed bug #76459 windows linkinfo lacks openbasedir check 2018-07-16 14:21:02 -07:00
Stanislav Malyshev 3462efa386 Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
Use MAKERNOTE length as data size.
2018-07-16 14:17:51 -07:00
Stanislav Malyshev 1baeae4270 Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c 2018-07-16 14:16:58 -07:00
Christoph M. Becker 8efd3c3387 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #73817: Incorrect entries in get_html_translation_table
2018-07-15 23:19:37 +02:00
Christoph M. Becker 0f8c1ee76d Fix #73817: Incorrect entries in get_html_translation_table
Due to incorrect string termination and length handling, several HTML
entities missed the trailing semicolon.

We also fix the obviously wrong expectations in two already existing
tests.
2018-07-15 23:06:38 +02:00
Anatol Belski dee191ee07 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Improve test
2018-07-13 20:14:44 +02:00
Anatol Belski 141072a838 Improve test
Ensure the filename is non existent indeed.
2018-07-13 20:13:51 +02:00
Anatol Belski f28aeaee05 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed RecursiveDirectoryIterator with long path or with edge case length
2018-07-12 19:57:08 +02:00
Anatol Belski 99fe18503a Fixed RecursiveDirectoryIterator with long path or with edge case length
The search path needs to be appended with the wild card. Till now, an
edge case existed, so then if a path is 259 bytes long, which is smaller
_MAX_PATH, the suffix would cause the final search path to become longer
than _MAX_PATH. It is an edge case, when the starting path happens to
have a specific length. If the starting path was longer than _MAX_PATH
or the addition of "\\*" would not exceed _MAX_PATH, the function was
correct. Except for rewind, which was broken in the case of the long
path.
2018-07-12 19:49:32 +02:00
Christoph M. Becker 77ced46dea Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix Travis build
2018-07-12 13:46:10 +02:00
Christoph M. Becker 236ae06e0b Fix Travis build
As of commit f9d1d1f[1] we require `sudo`, so we tell Travis about it.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=f9d1d1f>
2018-07-12 13:45:30 +02:00
Anatol Belski 9443c61928 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix macro
2018-07-12 11:37:13 +02:00
Anatol Belski cc7b000d2c Fix macro 2018-07-12 11:35:00 +02:00
Anatol Belski cc266045a5 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix condition
2018-07-11 13:13:56 +02:00
Anatol Belski 98102648cb Fix condition
It looks like the real length limit is 247 bytes, not 248 as documented.
2018-07-11 13:09:20 +02:00
Anatol Belski a766f65ca3 [ci skip] Update NEWS 2018-07-10 11:51:49 +02:00
Anatol Belski c23736216d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-07-10 11:51:11 +02:00
Anatol Belski 9026562c79 [ci skip] Update NEWS 2018-07-10 11:50:33 +02:00
Anatol Belski ebb590b625 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #76524 - ZipArchive memory leak
2018-07-10 11:19:54 +02:00
timurib 08f08858f3 Fix bug #76524 - ZipArchive memory leak
Bugfix #76524: Free up zip internal state and adjust the tests for Windows

Bugfix #76524: Fix possible use after free for libzip 1.3.1

Bugfix #76524: Make the test independent of platform
2018-07-10 11:18:37 +02:00
Anatol Belski 474292c3e4 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Sync callback signature with libxml2 2.9.8
2018-07-09 21:24:51 +02:00
Anatol Belski a820aab9da Sync callback signature with libxml2 2.9.8 2018-07-09 21:21:41 +02:00
Anatol Belski a6e8c73c43 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add missing flag
2018-07-09 15:14:30 +02:00
Anatol Belski 2c43fb49d6 Add missing flag 2018-07-09 15:12:52 +02:00
Anatol Belski 545a29d0cb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix C++11 and up compatibility for zend_finite and more
2018-07-08 20:32:52 +02:00
Anatol Belski ad790bea2e Fix C++11 and up compatibility for zend_finite and more
C++11 puts isfinite, isinf, isnan and a lot of other stuff into the
std namespace. Thus, if a C++11 or newer source is compiled, these
symbols won't be available. A good solution would be to include cmath,
but depending on a particular compiler that might remove even more
stuff from the global namespace, so such a fix should only target master.
For now, just keep these defines same for C++11 and upper, as the actual
C++ code should use symbols from the std namespace anyway. This
especially concerns older GCC versions like at least 4 and 5, which are
used by default in the LTS Linux distros.
2018-07-08 20:20:08 +02:00
Dylan K. Taylor 77a841db48 Fixed regex for checking libzip static lib
This bug caused linking issues in debug mode (see bug [#76564](https://bugs.php.net/bug.php?id=76564))

This issue affects PHP 7.2 and master.
2018-07-07 17:32:16 +02:00
Nikita Popov 5d0d812a53 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-07 12:08:02 +02:00
cdoco 47fb17b108 Fixed bug #76366 (references in sub-array for filtering breaks the filter) 2018-07-07 12:07:43 +02:00
Anatol Belski d207fd449c [ci skip] Update NEWS 2018-07-06 17:45:01 +02:00
Anatol Belski 1ae888d984 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-07-06 17:44:37 +02:00
Anatol Belski ea24847620 [ci skip] Update NEWS 2018-07-06 17:43:48 +02:00
Anatol Belski d85651d58d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix event log handling in startup phase
  Fix bug #76488 Memory leak when fetching a BLOB field
  Fix year
  Bump version
2018-07-06 16:08:17 +02:00
Anatol Belski 246cb03e26 Fix event log handling in startup phase
The log header can be saved in the globals on startup. At the same
time, the log header can be changed per request. In case that
happened, wrong pointer will be free'd on shutdown. It can happen at
any point when zend_error() or similar is called at startup, like for
example in the case of the ini deprecation warnings. Thus, ZMM cannot
be used here.
2018-07-06 16:07:28 +02:00
sim1984 3847a6fcb6 Fix bug #76488 Memory leak when fetching a BLOB field
Add a phpt test
2018-07-06 16:07:28 +02:00
Sara Golemon 137f22ad36 Fix year 2018-07-06 10:02:20 -04:00
Sara Golemon 268e801cb1 Bump version 2018-07-06 10:02:00 -04:00
Nikita Popov f3dc67b255 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-05 19:11:25 +02:00
Nikita Popov 791f07e4f0 Fix string.strip_tags filter
Was segfaulting if no allowed tags are specified and performing an
out of bounds read if they were.
2018-07-05 19:08:00 +02:00
Anatol Belski e5ef7cbe87 Fixed bug #76564 ext/zip link issues
Add zlib for linking directly, so then ext/zlib is not required.
2018-07-03 15:45:01 +02:00
Remi Collet 8bf21adb8c bump to 7.2.9-dev 2018-07-03 13:52:04 +02:00
44 changed files with 901 additions and 200 deletions

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.7beta1
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.7
PHP_BUILD_CRT: vc15
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
+1 -1
View File
@@ -1,6 +1,6 @@
dist: trusty
language: c
sudo: false
sudo: required
addons:
apt:
packages:
+40 -1
View File
@@ -1,6 +1,38 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.2.8
16 Aug 2018, PHP 7.2.9
- Calendar:
. Fixed bug #52974 (jewish.c: compile error under Windows with GBK charset).
(cmb)
- Filter:
. Fixed bug #76366 (References in sub-array for filtering breaks the filter).
(ZiHang Gao)
- PDO_Firebird:
. Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis)
- PDO_PgSQL:
. Fixed bug #75402 (Possible Memory Leak using PDO::CURSOR_SCROLL option).
(Anatol)
- SQLite3:
. Fixed #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle).
(cmb)
- Standard:
. Fixed bug #73817 (Incorrect entries in get_html_translation_table). (cmb)
. Fixed bug #68553 (array_column: null values in $index_key become incrementing
keys in result). (Laruence)
. Fixed bug #76643 (Segmentation fault when using `output_add_rewrite_var`).
(cmb)
- Zip:
. Fixed bug #76524 (ZipArchive memory leak (OVERWRITE flag and empty archive)).
(Timur Ibragimov)
19 Jul 2018, PHP 7.2.8
- Core:
. Fixed bug #76534 (PHP hangs on 'illegal string offset on string references
@@ -15,6 +47,10 @@ PHP NEWS
- EXIF:
. Fixed bug #76409 (heap use after free in _php_stream_free). (cmb)
. Fixed bug #76423 (Int Overflow lead to Heap OverFlow in
exif_thumbnail_extract of exif.c). (Stas)
. Fixed bug #76557 (heap-buffer-overflow (READ of size 48) while reading exif
data). (Stas)
- FPM:
. Fixed bug #73342 (Vulnerability in php-fpm by changing stdin to
@@ -53,6 +89,9 @@ PHP NEWS
(Laruence)
. Fixed bug #71848 (getimagesize with $imageinfo returns false). (cmb)
- Win32:
. Fixed bug #76459 (windows linkinfo lacks openbasedir check). (Anatol)
- ZIP:
. Fixed bug #76461 (OPSYS_Z_CPM defined instead of OPSYS_CPM).
(Dennis Birkholz, Remi)
+3 -3
View File
@@ -60,7 +60,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#include <math.h>
#ifndef zend_isnan
#if HAVE_DECL_ISNAN
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -69,7 +69,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#if HAVE_DECL_ISINF
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@@ -80,7 +80,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
+8 -1
View File
@@ -195,7 +195,14 @@ ZEND_API void * __zend_realloc(void *p, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(2)
#define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size))
#define safe_pemalloc(nmemb, size, offset, persistent) ((persistent)?_safe_malloc(nmemb, size, offset):safe_emalloc(nmemb, size, offset))
#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr))
#define pefree_size(ptr, size, persistent) ((persistent)?free(ptr):efree_size(ptr, size))
#define pefree_size(ptr, size, persistent) do { \
if (persistent) { \
free(ptr); \
} else { \
efree_size(ptr, size);\
} \
} while (0)
#define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size)))
#define perealloc(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc((ptr), (size)))
#define perealloc2(ptr, size, copy_size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc2((ptr), (size), (copy_size)))
+5 -5
View File
@@ -68,7 +68,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#include <math.h>
#ifndef zend_isnan
#if HAVE_DECL_ISNAN
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -77,7 +77,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#if HAVE_DECL_ISINF
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@@ -88,7 +88,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=2
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=9
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+25 -25
View File
@@ -340,38 +340,38 @@ char *JewishMonthName[14] =
char *JewishMonthHebNameLeap[14] =
{
"",
"úùøé",
"çùåï",
"ëñìå",
"èáú",
"ùáè",
"àãø à'",
"àãø á'",
"ðéñï",
"àééø",
"ñéåï",
"úîåæ",
"àá",
"àìåì"
"\xFA\xF9\xF8\xE9",
"\xE7\xF9\xE5\xEF",
"\xEB\xF1\xEC\xE5",
"\xE8\xE1\xFA",
"\xF9\xE1\xE8",
"\xE0\xE3\xF8 \xE0'",
"\xE0\xE3\xF8 \xE1'",
"\xF0\xE9\xF1\xEF",
"\xE0\xE9\xE9\xF8",
"\xF1\xE9\xe5\xEF",
"\xFA\xEE\xE5\xE6",
"\xE0\xE1",
"\xE0\xEC\xE5\xEC"
};
/* names for regular year */
char *JewishMonthHebName[14] =
{
"",
"úùøé",
"çùåï",
"ëñìå",
"èáú",
"ùáè",
"\xFA\xF9\xF8\xE9",
"\xE7\xF9\xE5\xEF",
"\xEB\xF1\xEC\xE5",
"\xE8\xE1\xFA",
"\xF9\xE1\xE8",
"",
"àãø",
"ðéñï",
"àééø",
"ñéåï",
"úîåæ",
"àá",
"àìåì"
"\xE0\xE3\xF8",
"\xF0\xE9\xF1\xEF",
"\xE0\xE9\xE9\xF8",
"\xF1\xE9\xE5\xEF",
"\xFA\xEE\xE5\xE6",
"\xE0\xE1",
"\xE0\xEC\xE5\xEC"
};
/************************************************************************
+53
View File
@@ -0,0 +1,53 @@
--TEST--
Test all hebrew month names
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip calendar extension not available');
?>
--FILE--
<?php
for ($year = 5000; $year <= 5001; $year++) {
$leap = ($year === 5001) ? 'leap' : 'normal';
echo "$leap year $year\n";
for ($month = 1; $month <= 13; $month++) {
$jd = jewishtojd($month, 1, $year);
$hebrew = jdtojewish($jd, true);
$hex = bin2hex($hebrew);
echo "$hex\n";
}
echo "\n";
}
?>
===DONE===
--EXPECT--
normal year 5000
e020faf9f8e920e4
e020e7f9e5ef20e4
e020ebf1ece520e4
e020e8e1fa20e4
e020f9e1e820e4
e020e0e3f820e02720e4
e020e0e3f820e12720e4
e020f0e9f1ef20e4
e020e0e9e9f820e4
e020f1e9e5ef20e4
e020faeee5e620e4
e020e0e120e4
e020e0ece5ec20e4
leap year 5001
e020faf9f8e920e4e0
e020e7f9e5ef20e4e0
e020ebf1ece520e4e0
e020e8e1fa20e4e0
e020f9e1e820e4e0
e020e0e3f820e4e0
e020e0e3f820e4e0
e020f0e9f1ef20e4e0
e020e0e9e9f820e4e0
e020f1e9e5ef20e4e0
e020faeee5e620e4e0
e020e0e120e4e0
e020e0ece5ec20e4e0
===DONE===
+5 -1
View File
@@ -42,7 +42,11 @@ struct _notationIterator {
xmlNotation *notation;
};
static void itemHashScanner (void *payload, void *data, xmlChar *name) /* {{{ */
#if LIBXML_VERSION >= 20908
static void itemHashScanner (void *payload, void *data, const xmlChar *name) /* {{{ */
#else
static void itemHashScanner (void *payload, void *data, xmlChar *name)
#endif
{
nodeIterator *priv = (nodeIterator *)data;
+9 -3
View File
@@ -2944,7 +2944,10 @@ static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, siz
return;
}
/* Check to make sure we are not going to go past the ExifLength */
if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) {
if (ImageInfo->Thumbnail.size > length
|| (ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length
|| ImageInfo->Thumbnail.offset > length - ImageInfo->Thumbnail.size
) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
return;
}
@@ -3126,7 +3129,8 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
#endif
const maker_note_type *maker_note;
char *dir_start;
int data_len;
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
#ifdef EXIF_DEBUG
@@ -3180,6 +3184,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
switch (maker_note->offset_mode) {
case MN_OFFSET_MAKER:
offset_base = value_ptr;
data_len = value_len;
break;
#ifdef KALLE_0
case MN_OFFSET_GUESS:
@@ -3197,6 +3202,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
return FALSE;
}
offset_base = value_ptr + offset_diff;
data_len = value_len - offset_diff;
break;
#endif
default:
@@ -3211,7 +3217,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table)) {
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
return FALSE;
}
}
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #76423 (Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c)
--SKIPIF--
<?php
if (!extension_loaded('exif')) die('skip exif extension not available');
?>
--FILE--
<?php
exif_read_data(__DIR__ . '/bug76423.jpg', 0, true, true);
?>
===DONE===
--EXPECTF--
Warning: exif_read_data(%s.jpg): Thumbnail goes IFD boundary or end of file reached in %s on line %d
Warning: exif_read_data(%s.jpg): File structure corrupted in %s on line %d
Warning: exif_read_data(%s.jpg): Invalid JPEG file in %s on line %d
===DONE===
Binary file not shown.
+79
View File
@@ -0,0 +1,79 @@
--TEST--
Bug 76557 (heap-buffer-overflow (READ of size 48) while reading exif data)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
var_dump(exif_read_data(dirname(__FILE__) . "/bug76557.jpg"));
?>
DONE
--EXPECTF--
Warning: exif_read_data(bug76557.jpg): Process tag(x010F=Make ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x8769=Exif_IFD_Po): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x927C=MakerNote ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > x00EE) in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): File structure corrupted in %sbug76557.php on line %d
Warning: exif_read_data(bug76557.jpg): Invalid JPEG file in %sbug76557.php on line %d
bool(false)
DONE
+3
View File
@@ -621,6 +621,9 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
}
if ((option = zend_hash_str_find(HASH_OF(filter_args), "options", sizeof("options") - 1)) != NULL) {
/* avoid reference type */
ZVAL_DEREF(option);
if (filter != FILTER_CALLBACK) {
if (Z_TYPE_P(option) == IS_ARRAY) {
options = option;
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Bug #76366 (references in sub-array for filtering breaks the filter)
--SKIPIF--
<?php
if (!extension_loaded('filter')) die('skip filter extension not available');
?>
--FILE--
<?php
#array to filter
$data = ['foo' => 6];
#filter args
$args = [
'foo'=> [
'filter' => FILTER_VALIDATE_INT,
'flags' => FILTER_FORCE_ARRAY
]
];
$args['foo']['options'] = [];
#create reference
$options = &$args['foo']['options'];
#set options
$options['min_range'] = 1;
$options['max_range'] = 5;
#show the filter result
var_dump(filter_var_array($data, $args));
?>
--EXPECT--
array(1) {
["foo"]=>
array(1) {
[0]=>
bool(false)
}
}
+1 -1
View File
@@ -294,7 +294,7 @@ static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ *
unsigned short seg_len;
ISC_STATUS stat;
*ptr = S->fetch_buf[colno] = erealloc(*ptr, *len+1);
*ptr = S->fetch_buf[colno] = erealloc(S->fetch_buf[colno], *len+1);
for (cur_len = stat = 0; (!stat || stat == isc_segment) && cur_len < *len; cur_len += seg_len) {
+32
View File
@@ -0,0 +1,32 @@
--TEST--
PDO_Firebird: Bug #76488 Memory leak when fetching a BLOB field
--SKIPIF--
<?php if (!extension_loaded('interbase') || !extension_loaded('pdo_firebird')) die('skip'); ?>
--FILE--
<?php
require 'testdb.inc';
$dbh = new PDO('firebird:dbname='.$test_base, $user, $password) or die;
$sql = '
with recursive r(n) as (
select 1 from rdb$database
union all
select n+1 from r where n < 1000
)
select n,
cast(lpad(\'A\', 8000, \'A\') as BLOB sub_type TEXT) as SRC
from r
';
for ($i = 0; $i < 10; $i++) {
$sth = $dbh->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
unset($rows);
unset($sth);
}
unset($dbh);
echo "OK";
?>
--EXPECT--
OK
+3
View File
@@ -11,6 +11,9 @@ if (PHP_PDO_PGSQL != "no") {
if (CHECK_HEADER_ADD_INCLUDE("pg_config.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) {
ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PG_CONFIG_H");
}
if (X64) {
ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PG_LO64=1");
}
AC_DEFINE('HAVE_PDO_PGSQL', 1, 'Have PostgreSQL library');
+6
View File
@@ -165,6 +165,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
pdo_pgsql_error_stmt(stmt, status, pdo_pgsql_sqlstate(S->result));
return 0;
}
PQclear(S->result);
/* the cursor was declared correctly */
S->is_prepared = 1;
@@ -434,6 +435,11 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
return 0;
}
if(S->result) {
PQclear(S->result);
S->result = NULL;
}
spprintf(&q, 0, "FETCH %s FROM %s", ori_str, S->cursor_name);
efree(ori_str);
S->result = PQexec(S->H->server, q);
+113
View File
@@ -0,0 +1,113 @@
--TEST--
PDO PgSQL Bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
$resp = new \stdClass();
$resp->entries = [];
$db->query('DROP TABLE IF EXISTS bug75402 CASCADE');
$db->query('CREATE TABLE bug75402 (
"id" character varying(64) NOT NULL,
"group_id" character varying(64) NOT NULL,
"submitter" character varying(320) NOT NULL,
"operation" character varying(32) NOT NULL,
"description" character varying(320) NOT NULL,
"stage" character varying(16) NOT NULL,
"status" character varying(64) NOT NULL,
"progress" integer NOT NULL,
"insert_datetime" timestamp(3) NOT NULL,
"begin_datetime" timestamp(3),
"end_datetime" timestamp(3),
"life_hours" integer NOT NULL,
"family" character varying(32) NOT NULL,
"parallelism_group" character varying(32) NOT NULL,
"max_parallelism" integer NOT NULL,
"hidden" boolean NOT NULL,
"abort" boolean NOT NULL,
"order_folder_pathname" character varying(320),
"worker" character varying(32) NOT NULL,
CONSTRAINT "pk_bug75402" PRIMARY KEY ("id")
) WITH (oids = false);');
$db->query("INSERT INTO bug75402 (\"id\", \"group_id\", \"submitter\", \"operation\", \"description\", \"stage\", \"status\", \"progress\", \"insert_datetime\", \"begin_datetime\", \"end_datetime\", \"life_hours\", \"family\", \"parallelism_group\", \"max_parallelism\", \"hidden\", \"abort\", \"order_folder_pathname\", \"worker\") VALUES
('20171016083645_5337', 'G_20171016083645_5337', 'TESTPetunia', 'IMPORT', '', 'DON', 'Completed', 100, '2017-10-16 08:36:45', '2017-10-16 08:36:46', '2017-10-16 08:36:46', 96, 'IMPORT', '', -1, 'f', 'f', 'C:\ProgramData\TestPath\TestApp\Jobs\Jobs\\20171016083645_5337', 'MainService')");
$sql = "SELECT
ID as \"sID\",
GROUP_ID as \"sGroupID\",
SUBMITTER as \"sOwner\",
OPERATION as \"sOperation\",
DESCRIPTION as \"sInfo\",
STAGE as \"sShortStatus\",
STATUS as \"sStatus\",
PROGRESS as \"sProgress\",
HIDDEN as \"bHidden\",
to_char(INSERT_DATETIME, 'IYYY.MM.DD HH24:MI:SS') as \"sDatetime\"
FROM bug75402
ORDER BY INSERT_DATETIME DESC";
if ($db) {
$stmt = $db->prepare($sql,
array(
// With the following options memory is not being
// deallocated
\PDO::ATTR_CURSOR => \PDO::CURSOR_SCROLL
// With the following option memory is de-allocated
// \PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY
)
);
$stmt->execute();
while ($entry = $stmt->fetchObject()) {
$resp->entries [] = $entry;
}
$stmt->closeCursor();
$stmt = null;
$db = null;
}
var_dump($resp);
--EXPECT--
object(stdClass)#2 (1) {
["entries"]=>
array(1) {
[0]=>
object(stdClass)#4 (10) {
["sid"]=>
string(19) "20171016083645_5337"
["sgroupid"]=>
string(21) "G_20171016083645_5337"
["sowner"]=>
string(11) "TESTPetunia"
["soperation"]=>
string(6) "IMPORT"
["sinfo"]=>
string(0) ""
["sshortstatus"]=>
string(3) "DON"
["sstatus"]=>
string(9) "Completed"
["sprogress"]=>
string(3) "100"
["bhidden"]=>
bool(false)
["sdatetime"]=>
string(19) "2017.10.16 08:36:45"
}
}
}
+1 -1
View File
@@ -1595,7 +1595,7 @@ PHP_METHOD(sqlite3stmt, execute)
break;
case SQLITE_FLOAT:
/* convert_to_double(parameter);*/
convert_to_double(parameter);
sqlite3_bind_double(stmt_obj->stmt, param->param_number, Z_DVAL_P(parameter));
break;
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle)
--SKIPIF--
<?php
if (!extension_loaded('sqlite3')) die('skip sqlite3 extension not available');
?>
--FILE--
<?php
$db = new SQLite3(':memory:');
$db->exec("CREATE TABLE foo (bar REAL)");
$stmt = $db->prepare("INSERT INTO foo VALUES (:bar)");
$stmt->bindValue(':bar', 17, SQLITE3_FLOAT);
$stmt->execute();
var_dump($db->querySingle("SELECT bar FROM foo LIMIT 1"));
?>
===DONE===
--EXPECT--
float(17)
===DONE===
+32 -10
View File
@@ -4228,16 +4228,38 @@ PHP_FUNCTION(array_column)
zkeyval = array_column_fetch_prop(data, zkey, &rvk);
}
if (zkeyval) {
if (Z_TYPE_P(zkeyval) == IS_STRING) {
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(zkeyval), zcolval);
} else if (Z_TYPE_P(zkeyval) == IS_LONG) {
add_index_zval(return_value, Z_LVAL_P(zkeyval), zcolval);
} else if (Z_TYPE_P(zkeyval) == IS_OBJECT) {
zend_string *key = zval_get_string(zkeyval);
zend_symtable_update(Z_ARRVAL_P(return_value), key, zcolval);
zend_string_release(key);
} else {
add_next_index_zval(return_value, zcolval);
switch (Z_TYPE_P(zkeyval)) {
case IS_STRING:
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(zkeyval), zcolval);
break;
case IS_LONG:
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_P(zkeyval), zcolval);
break;
case IS_OBJECT:
{
zend_string *key = zval_get_string(zkeyval);
zend_symtable_update(Z_ARRVAL_P(return_value), key, zcolval);
zend_string_release(key);
break;
}
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(return_value), ZSTR_EMPTY_ALLOC(), zcolval);
break;
case IS_DOUBLE:
zend_hash_index_update(Z_ARRVAL_P(return_value), zend_dval_to_lval(Z_DVAL_P(zkeyval)), zcolval);
break;
case IS_TRUE:
zend_hash_index_update(Z_ARRVAL_P(return_value), 1, zcolval);
break;
case IS_FALSE:
zend_hash_index_update(Z_ARRVAL_P(return_value), 0, zcolval);
break;
case IS_RESOURCE:
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_RES_HANDLE_P(zkeyval), zcolval);
break;
default:
add_next_index_zval(return_value, zcolval);
break;
}
if (zkeyval == &rvk) {
zval_ptr_dtor(&rvk);
+18 -13
View File
@@ -176,12 +176,14 @@ typedef struct _php_strip_tags_filter {
uint8_t persistent;
} php_strip_tags_filter;
static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *allowed_tags, size_t allowed_tags_len, int persistent)
static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, zend_string *allowed_tags, int persistent)
{
if (allowed_tags != NULL) {
inst->allowed_tags = pemalloc(allowed_tags_len, persistent);
memcpy((char *)inst->allowed_tags, allowed_tags, allowed_tags_len);
inst->allowed_tags_len = (int)allowed_tags_len;
if (NULL == (inst->allowed_tags = pemalloc(ZSTR_LEN(allowed_tags) + 1, persistent))) {
return FAILURE;
}
memcpy((char *)inst->allowed_tags, ZSTR_VAL(allowed_tags), ZSTR_LEN(allowed_tags) + 1);
inst->allowed_tags_len = (int)ZSTR_LEN(allowed_tags);
} else {
inst->allowed_tags = NULL;
}
@@ -245,12 +247,14 @@ static php_stream_filter_ops strfilter_strip_tags_ops = {
static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, uint8_t persistent)
{
php_strip_tags_filter *inst;
smart_str tags_ss = {0};
php_stream_filter *filter = NULL;
zend_string *allowed_tags = NULL;;
inst = pemalloc(sizeof(php_strip_tags_filter), persistent);
if (filterparams != NULL) {
if (Z_TYPE_P(filterparams) == IS_ARRAY) {
smart_str tags_ss = {0};
zval *tmp;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(filterparams), tmp) {
@@ -260,22 +264,23 @@ static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zv
smart_str_appendc(&tags_ss, '>');
} ZEND_HASH_FOREACH_END();
smart_str_0(&tags_ss);
allowed_tags = tags_ss.s;
} else {
/* FIXME: convert_to_* may clutter zvals and lead it into segfault ? */
convert_to_string_ex(filterparams);
smart_str_setl(&tags_ss, Z_STRVAL_P(filterparams), Z_STRLEN_P(filterparams));
allowed_tags = zval_get_string(filterparams);
}
}
if (php_strip_tags_filter_ctor(inst, ZSTR_VAL(tags_ss.s), ZSTR_LEN(tags_ss.s), persistent) != SUCCESS) {
smart_str_free(&tags_ss);
if (php_strip_tags_filter_ctor(inst, allowed_tags, persistent) == SUCCESS) {
filter = php_stream_filter_alloc(&strfilter_strip_tags_ops, inst, persistent);
} else {
pefree(inst, persistent);
return NULL;
}
smart_str_free(&tags_ss);
if (allowed_tags) {
zend_string_release(allowed_tags);
}
return php_stream_filter_alloc(&strfilter_strip_tags_ops, inst, persistent);
return filter;
}
static php_stream_filter_factory strfilter_strip_tags_factory = {
+1 -2
View File
@@ -1595,8 +1595,7 @@ static inline void write_s3row_data(
written_k2 = write_octet_sequence((unsigned char*)&key[written_k1], charset, spe_cp);
memcpy(&entity[1], mcpr[i].normal_entry.entity, l);
entity[l + 1] = ';';
entity[l + 1] = '\0';
add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 1);
add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 2);
}
}
}
+11
View File
@@ -87,6 +87,7 @@ PHP_FUNCTION(readlink)
PHP_FUNCTION(linkinfo)
{
char *link;
char *dirname;
size_t link_len;
zend_stat_t sb;
int ret;
@@ -95,12 +96,22 @@ PHP_FUNCTION(linkinfo)
return;
}
dirname = estrndup(link, link_len);
php_dirname(dirname, link_len);
if (php_check_open_basedir(dirname)) {
efree(dirname);
RETURN_FALSE;
}
ret = VCWD_STAT(link, &sb);
if (ret == -1) {
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
efree(dirname);
RETURN_LONG(Z_L(-1));
}
efree(dirname);
RETURN_LONG((zend_long) sb.st_dev);
}
/* }}} */
+66
View File
@@ -0,0 +1,66 @@
--TEST--
Bug #68553 (array_column: null values in $index_key become incrementing keys in result)
--FILE--
<?php
$i = 100;
/* increase the resource id to make test stable */
while ($i--) {
$fd = fopen(__FILE__, "r");
fclose($fd);
}
$a = [
['a' => 10],
['a' => 20],
['a' => true],
['a' => false],
['a' => fopen(__FILE__, "r")],
['a' => -5],
['a' => 7.38],
['a' => null, "test"],
['a' => null],
];
var_dump(array_column($a, null, 'a'));
--EXPECTF--
array(8) {
[10]=>
array(1) {
["a"]=>
int(10)
}
[20]=>
array(1) {
["a"]=>
int(20)
}
[1]=>
array(1) {
["a"]=>
bool(true)
}
[0]=>
array(1) {
["a"]=>
bool(false)
}
[%d]=>
array(1) {
["a"]=>
resource(%d) of type (stream)
}
[-5]=>
array(1) {
["a"]=>
int(-5)
}
[7]=>
array(1) {
["a"]=>
float(7.38)
}
[""]=>
array(1) {
["a"]=>
NULL
}
}
@@ -0,0 +1,65 @@
--TEST--
RecursiveDirectoryIterator with dir path long or of edge case length
--SKIPIF--
<?php
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
skip_if_not_win();
if (strlen(dirname(__FILE__)) > 259) die("Unsuitable starting path length");
?>
--FILE--
<?php
$need_len = 1024;
//$need_len = 259;
$dir = dirname(__FILE__);
while ($need_len - strlen($dir) > 32) {
$dir .= DIRECTORY_SEPARATOR . str_repeat("a", 32);
}
$dir .= DIRECTORY_SEPARATOR . str_repeat("a", $need_len - strlen($dir));
mkdir($dir, 0700, true);
$fl = $dir . DIRECTORY_SEPARATOR . "hello.txt";
file_put_contents($fl, "");
$start = substr($dir, 0, strpos($dir, DIRECTORY_SEPARATOR, strlen(dirname(__FILE__))+1));
$iter = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$start,
FilesystemIterator::SKIP_DOTS
),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($iter as $item) {
if (!$item->isDir()) {
var_dump($item->getPathname());
}
}
$iter->rewind();
foreach ($iter as $item) {
if ($item->isDir()) {
rmdir($item->getPathname());
} else {
unlink($item->getPathname());
}
}
rmdir($start);
var_dump(file_exists($start));
/*unlink($fl);
do {
rmdir($dir);
$dir = dirname($dir);
} while (dirname(__FILE__) != $dir);*/
?>
==DONE==
--EXPECTF--
string(%d) "%shello.txt"
bool(false)
==DONE==
@@ -0,0 +1,24 @@
--TEST--
string.strip_tags filter
--FILE--
<?php
$fp = fopen('php://output', 'w');
stream_filter_append($fp, 'string.strip_tags');
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n");
fclose($fp);
$fp = fopen('php://output', 'w');
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, "<b>");
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n");
fclose($fp);
$fp = fopen('php://output', 'w');
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, ["b"]);
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n");
fclose($fp);
?>
--EXPECT--
test bold italic test
test <b>bold</b> italic test
test <b>bold</b> italic test
@@ -0,0 +1,12 @@
--TEST--
Bug #76643 (Segmentation fault when using `output_add_rewrite_var`)
--FILE--
<?php
$_SERVER = 'foo';
output_add_rewrite_var('bar', 'baz');
?>
<form action="http://example.com/"></form>
===DONE===
--EXPECT--
<form action="http://example.com/"></form>
===DONE===
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #73817 (Incorrect entries in get_html_translation_table)
--FILE--
<?php
$entities = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES | ENT_HTML5);
foreach ($entities as $entity) {
if (substr($entity, -1) !== ';') {
var_dump($entity);
}
}
?>
===DONE===
--EXPECT--
===DONE===
@@ -273,27 +273,27 @@ Array
[≢] => &NotCongruent;
[≭] => &NotCupCap;
[≠] => &NotEqual;
[≧̸] => &NotGreaterFullEqual
[≫̸] => &NotGreaterGreater
[≧̸] => &NotGreaterFullEqual;
[≫̸] => &NotGreaterGreater;
[≹] => &NotGreaterLess;
[⧏̸] => &NotLeftTriangleBar
[⧏̸] => &NotLeftTriangleBar;
[≮] => &NotLess;
[≰] => &NotLessEqual;
[⪢̸] => &NotNestedGreaterGreater
[⪡̸] => &NotNestedLessLess
[⪯̸] => &NotPrecedesEqual
[⪢̸] => &NotNestedGreaterGreater;
[⪡̸] => &NotNestedLessLess;
[⪯̸] => &NotPrecedesEqual;
[⋠] => &NotPrecedesSlantEqual;
[⧐̸] => &NotRightTriangleBar
[⧐̸] => &NotRightTriangleBar;
[⋭] => &NotRightTriangleEqual;
[⊏̸] => &NotSquareSubset
[⊏̸] => &NotSquareSubset;
[⋢] => &NotSquareSubsetEqual;
[⊐̸] => &NotSquareSuperset
[⊐̸] => &NotSquareSuperset;
[⋣] => &NotSquareSupersetEqual;
[⊈] => &NotSubsetEqual;
[⊁] => &NotSucceeds;
[⪰̸] => &NotSucceedsEqual
[⪰̸] => &NotSucceedsEqual;
[⋡] => &NotSucceedsSlantEqual;
[≿̸] => &NotSucceedsTilde
[≿̸] => &NotSucceedsTilde;
[⊉] => &NotSupersetEqual;
[≁] => &NotTilde;
[𝒩] => &Nscr;
@@ -394,7 +394,7 @@ Array
[Т] => &Tcy;
[𝔗] => &Tfr;
[Θ] => &Theta;
[  ] => &ThickSpace
[  ] => &ThickSpace;
[ ] => &ThinSpace;
[≅] => &TildeFullEqual;
[𝕋] => &Topf;
@@ -469,7 +469,7 @@ Array
[á] => &aacute;
[ă] => &abreve;
[∾] => &ac;
[∾̳] => &acE
[∾̳] => &acE;
[∿] => &acd;
[â] => &acirc;
[а] => &acy;
@@ -552,8 +552,8 @@ Array
[░] => &blk14;
[▓] => &blk34;
[█] => &block;
[=⃥] => &bne
[≡⃥] => &bnequiv
[=⃥] => &bne;
[≡⃥] => &bnequiv;
[⌐] => &bnot;
[𝕓] => &bopf;
[⋈] => &bowtie;
@@ -616,7 +616,7 @@ Array
[⩋] => &capcap;
[⩇] => &capcup;
[⩀] => &capdot;
[∩︀] => &caps
[∩︀] => &caps;
[⁁] => &caret;
[⩍] => &ccaps;
[č] => &ccaron;
@@ -668,7 +668,7 @@ Array
[⩊] => &cupcup;
[⊍] => &cupdot;
[⩅] => &cupor;
[∪︀] => &cups
[∪︀] => &cups;
[↷] => &curarr;
[⤼] => &curarrm;
[⋞] => &curlyeqprec;
@@ -772,7 +772,7 @@ Array
[ffl] => &ffllig;
[𝔣] => &ffr;
[fi] => &filig;
[fj] => &fjlig
[fj] => &fjlig;
[♭] => &flat;
[fl] => &fllig;
[▱] => &fltns;
@@ -814,7 +814,7 @@ Array
[⪀] => &gesdot;
[⪂] => &gesdoto;
[⪄] => &gesdotol;
[⋛︀] => &gesl
[⋛︀] => &gesl;
[⪔] => &gesles;
[𝔤] => &gfr;
[≫] => &gg;
@@ -841,7 +841,7 @@ Array
[⥸] => &gtrarr;
[⋗] => &gtrdot;
[⋛] => &gtreqless;
[≩︀] => &gvertneqq
[≩︀] => &gvertneqq;
[⇔] => &hArr;
[ ] => &hairsp;
[½] => &half;
@@ -940,7 +940,7 @@ Array
[⪫] => &lat;
[⤙] => &latail;
[⪭] => &late;
[⪭︀] => &lates
[⪭︀] => &lates;
[⤌] => &lbarr;
[❲] => &lbbrk;
[{] => &lbrace;
@@ -965,7 +965,7 @@ Array
[⩿] => &lesdot;
[⪁] => &lesdoto;
[⪃] => &lesdotor;
[⋚︀] => &lesg
[⋚︀] => &lesg;
[⪓] => &lesges;
[⋖] => &lessdot;
[⋚] => &lesseqgtr;
@@ -1022,7 +1022,7 @@ Array
[◃] => &ltri;
[⥊] => &lurdshar;
[⥦] => &luruhar;
[≨︀] => &lvertneqq
[≨︀] => &lvertneqq;
[∺] => &mDDot;
[¯] => &macr;
[♂] => &male;
@@ -1046,42 +1046,42 @@ Array
[𝓂] => &mscr;
[μ] => &mu;
[⊸] => &mumap;
[⋙̸] => &nGg
[≫⃒] => &nGt
[⋙̸] => &nGg;
[≫⃒] => &nGt;
[⇍] => &nLeftarrow;
[⋘̸] => &nLl
[≪⃒] => &nLt
[≪̸] => &nLtv
[⋘̸] => &nLl;
[≪⃒] => &nLt;
[≪̸] => &nLtv;
[⊯] => &nVDash;
[⊮] => &nVdash;
[∇] => &nabla;
[ń] => &nacute;
[∠⃒] => &nang
[⩰̸] => &napE
[≋̸] => &napid
[∠⃒] => &nang;
[⩰̸] => &napE;
[≋̸] => &napid;
[ʼn] => &napos;
[≉] => &napprox;
[♮] => &natur;
[ℕ] => &naturals;
[ ] => &nbsp;
[≎̸] => &nbump
[≏̸] => &nbumpe
[≎̸] => &nbump;
[≏̸] => &nbumpe;
[⩃] => &ncap;
[ň] => &ncaron;
[ņ] => &ncedil;
[≇] => &ncong;
[⩭̸] => &ncongdot
[⩭̸] => &ncongdot;
[⩂] => &ncup;
[н] => &ncy;
[–] => &ndash;
[⇗] => &neArr;
[⤤] => &nearhk;
[≐̸] => &nedot
[≂̸] => &nesim
[≐̸] => &nedot;
[≂̸] => &nesim;
[∄] => &nexist;
[𝔫] => &nfr;
[≱] => &ngeq;
[⩾̸] => &nges
[⩾̸] => &nges;
[≵] => &ngsim;
[≯] => &ngtr;
[⇎] => &nhArr;
@@ -1089,41 +1089,41 @@ Array
[⋼] => &nis;
[⋺] => &nisd;
[њ] => &njcy;
[≦̸] => &nlE
[≦̸] => &nlE;
[‥] => &nldr;
[↚] => &nleftarrow;
[↮] => &nleftrightarrow;
[⩽̸] => &nles
[⩽̸] => &nles;
[≴] => &nlsim;
[⋪] => &nltri;
[⋬] => &nltrie;
[𝕟] => &nopf;
[¬] => &not;
[∉] => &notin;
[⋹̸] => &notinE
[⋵̸] => &notindot
[⋹̸] => &notinE;
[⋵̸] => &notindot;
[⋷] => &notinvb;
[⋶] => &notinvc;
[∌] => &notniva;
[⋾] => &notnivb;
[⋽] => &notnivc;
[∦] => &nparallel;
[⫽⃥] => &nparsl
[∂̸] => &npart
[⫽⃥] => &nparsl;
[∂̸] => &npart;
[⨔] => &npolint;
[⊀] => &npr;
[⇏] => &nrArr;
[↛] => &nrarr;
[⤳̸] => &nrarrc
[↝̸] => &nrarrw
[⤳̸] => &nrarrc;
[↝̸] => &nrarrw;
[𝓃] => &nscr;
[∤] => &nshortmid;
[≄] => &nsime;
[⊄] => &nsub;
[⫅̸] => &nsubE
[⫅̸] => &nsubE;
[⊅] => &nsup;
[⊃⃒] => &nsupset
[⫆̸] => &nsupseteqq
[⊃⃒] => &nsupset;
[⫆̸] => &nsupseteqq;
[ñ] => &ntilde;
[≸] => &ntlg;
[⋫] => &ntriangleright;
@@ -1133,18 +1133,18 @@ Array
[ ] => &numsp;
[⊭] => &nvDash;
[⤄] => &nvHarr;
[≍⃒] => &nvap
[≍⃒] => &nvap;
[⊬] => &nvdash;
[≥⃒] => &nvge
[>⃒] => &nvgt
[≥⃒] => &nvge;
[>⃒] => &nvgt;
[⧞] => &nvinfin;
[⤂] => &nvlArr;
[≤⃒] => &nvle
[<⃒] => &nvlt
[⊴⃒] => &nvltrie
[≤⃒] => &nvle;
[<⃒] => &nvlt;
[⊴⃒] => &nvltrie;
[⤃] => &nvrArr;
[⊵⃒] => &nvrtrie
[∼⃒] => &nvsim
[⊵⃒] => &nvrtrie;
[∼⃒] => &nvsim;
[⇖] => &nwArr;
[⤣] => &nwarhk;
[↖] => &nwarrow;
@@ -1254,7 +1254,7 @@ Array
[⇛] => &rAarr;
[⤜] => &rAtail;
[⥤] => &rHar;
[∽̱] => &race
[∽̱] => &race;
[ŕ] => &racute;
[⦳] => &raemptyv;
[⦒] => &rangd;
@@ -1364,7 +1364,7 @@ Array
[⌣] => &smile;
[⪪] => &smt;
[⪬] => &smte;
[⪬︀] => &smtes
[⪬︀] => &smtes;
[ь] => &softcy;
[/] => &sol;
[⧄] => &solb;
@@ -1372,9 +1372,9 @@ Array
[𝕤] => &sopf;
[♠] => &spadesuit;
[⊓] => &sqcap;
[⊓︀] => &sqcaps
[⊓︀] => &sqcaps;
[⊔] => &sqcup;
[⊔︀] => &sqcups
[⊔︀] => &sqcups;
[⊏] => &sqsub;
[⊐] => &sqsupset;
[▪] => &squarf;
@@ -1501,7 +1501,7 @@ Array
[⫩] => &vBarv;
[⦜] => &vangrt;
[ϰ] => &varkappa;
[⫌︀] => &varsupsetneqq
[⫌︀] => &varsupsetneqq;
[⊲] => &vartriangleleft;
[в] => &vcy;
[⊢] => &vdash;
@@ -1510,13 +1510,13 @@ Array
[⋮] => &vellip;
[|] => &vert;
[𝔳] => &vfr;
[⊂⃒] => &vnsub
[⊂⃒] => &vnsub;
[𝕧] => &vopf;
[⊳] => &vrtri;
[𝓋] => &vscr;
[⫋︀] => &vsubnE
[⊊︀] => &vsubne
[⊋︀] => &vsupne
[⫋︀] => &vsubnE;
[⊊︀] => &vsubne;
[⊋︀] => &vsupne;
[⦚] => &vzigzag;
[ŵ] => &wcirc;
[⩟] => &wedbar;
@@ -81,7 +81,7 @@ Array
[^] => &Hat;
[_] => &lowbar;
[`] => &grave;
[fj] => &fjlig
[fj] => &fjlig;
[{] => &lbrace;
[|] => &vert;
[}] => &rcub;
+45 -44
View File
@@ -352,6 +352,7 @@ static int check_http_host(char *target)
char *colon;
if ((tmp = zend_hash_str_find(&EG(symbol_table), ZEND_STRL("_SERVER"))) &&
Z_TYPE_P(tmp) == IS_ARRAY &&
(host = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("HTTP_HOST"))) &&
Z_TYPE_P(host) == IS_STRING) {
host_tmp = zend_string_init(Z_STRVAL_P(host), Z_STRLEN_P(host), 0);
@@ -519,7 +520,7 @@ state_plain_begin:
state_plain:
start = YYCURSOR;
#line 523 "ext/standard/url_scanner_ex.c"
#line 524 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -569,22 +570,22 @@ yy2:
if (yybm[0+yych] & 128) {
goto yy2;
}
#line 526 "ext/standard/url_scanner_ex.re"
#line 527 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain; }
#line 575 "ext/standard/url_scanner_ex.c"
#line 576 "ext/standard/url_scanner_ex.c"
yy5:
++YYCURSOR;
#line 525 "ext/standard/url_scanner_ex.re"
#line 526 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
#line 580 "ext/standard/url_scanner_ex.c"
#line 581 "ext/standard/url_scanner_ex.c"
}
#line 527 "ext/standard/url_scanner_ex.re"
#line 528 "ext/standard/url_scanner_ex.re"
state_tag:
start = YYCURSOR;
#line 588 "ext/standard/url_scanner_ex.c"
#line 589 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -627,9 +628,9 @@ state_tag:
goto yy11;
}
++YYCURSOR;
#line 533 "ext/standard/url_scanner_ex.re"
#line 534 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
#line 633 "ext/standard/url_scanner_ex.c"
#line 634 "ext/standard/url_scanner_ex.c"
yy11:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -637,11 +638,11 @@ yy11:
if (yybm[0+yych] & 128) {
goto yy11;
}
#line 532 "ext/standard/url_scanner_ex.re"
#line 533 "ext/standard/url_scanner_ex.re"
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
#line 643 "ext/standard/url_scanner_ex.c"
#line 644 "ext/standard/url_scanner_ex.c"
}
#line 534 "ext/standard/url_scanner_ex.re"
#line 535 "ext/standard/url_scanner_ex.re"
state_next_arg_begin:
@@ -650,7 +651,7 @@ state_next_arg_begin:
state_next_arg:
start = YYCURSOR;
#line 654 "ext/standard/url_scanner_ex.c"
#line 655 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -706,9 +707,9 @@ state_next_arg:
yy16:
++YYCURSOR;
yy17:
#line 545 "ext/standard/url_scanner_ex.re"
#line 546 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
#line 712 "ext/standard/url_scanner_ex.c"
#line 713 "ext/standard/url_scanner_ex.c"
yy18:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -716,30 +717,30 @@ yy18:
if (yybm[0+yych] & 128) {
goto yy18;
}
#line 543 "ext/standard/url_scanner_ex.re"
#line 544 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg; }
#line 722 "ext/standard/url_scanner_ex.c"
#line 723 "ext/standard/url_scanner_ex.c"
yy21:
yych = *++YYCURSOR;
if (yych != '>') goto yy17;
yy22:
++YYCURSOR;
#line 542 "ext/standard/url_scanner_ex.re"
#line 543 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
#line 730 "ext/standard/url_scanner_ex.c"
#line 731 "ext/standard/url_scanner_ex.c"
yy24:
++YYCURSOR;
#line 544 "ext/standard/url_scanner_ex.re"
#line 545 "ext/standard/url_scanner_ex.re"
{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
#line 735 "ext/standard/url_scanner_ex.c"
#line 736 "ext/standard/url_scanner_ex.c"
}
#line 546 "ext/standard/url_scanner_ex.re"
#line 547 "ext/standard/url_scanner_ex.re"
state_arg:
start = YYCURSOR;
#line 743 "ext/standard/url_scanner_ex.c"
#line 744 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -784,9 +785,9 @@ state_arg:
if (yych <= 'z') goto yy30;
yy28:
++YYCURSOR;
#line 552 "ext/standard/url_scanner_ex.re"
#line 553 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
#line 790 "ext/standard/url_scanner_ex.c"
#line 791 "ext/standard/url_scanner_ex.c"
yy30:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -794,17 +795,17 @@ yy30:
if (yybm[0+yych] & 128) {
goto yy30;
}
#line 551 "ext/standard/url_scanner_ex.re"
#line 552 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
#line 800 "ext/standard/url_scanner_ex.c"
#line 801 "ext/standard/url_scanner_ex.c"
}
#line 553 "ext/standard/url_scanner_ex.re"
#line 554 "ext/standard/url_scanner_ex.re"
state_before_val:
start = YYCURSOR;
#line 808 "ext/standard/url_scanner_ex.c"
#line 809 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -847,9 +848,9 @@ state_before_val:
if (yych == '=') goto yy38;
++YYCURSOR;
yy36:
#line 559 "ext/standard/url_scanner_ex.re"
#line 560 "ext/standard/url_scanner_ex.re"
{ --YYCURSOR; goto state_next_arg_begin; }
#line 853 "ext/standard/url_scanner_ex.c"
#line 854 "ext/standard/url_scanner_ex.c"
yy37:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ' ') goto yy41;
@@ -861,9 +862,9 @@ yy38:
if (yybm[0+yych] & 128) {
goto yy38;
}
#line 558 "ext/standard/url_scanner_ex.re"
#line 559 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
#line 867 "ext/standard/url_scanner_ex.c"
#line 868 "ext/standard/url_scanner_ex.c"
yy41:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -873,14 +874,14 @@ yy41:
YYCURSOR = YYMARKER;
goto yy36;
}
#line 560 "ext/standard/url_scanner_ex.re"
#line 561 "ext/standard/url_scanner_ex.re"
state_val:
start = YYCURSOR;
#line 884 "ext/standard/url_scanner_ex.c"
#line 885 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -933,15 +934,15 @@ yy46:
if (yybm[0+yych] & 32) {
goto yy46;
}
#line 568 "ext/standard/url_scanner_ex.re"
#line 569 "ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
#line 939 "ext/standard/url_scanner_ex.c"
#line 940 "ext/standard/url_scanner_ex.c"
yy49:
++YYCURSOR;
yy50:
#line 569 "ext/standard/url_scanner_ex.re"
#line 570 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg_begin; }
#line 945 "ext/standard/url_scanner_ex.c"
#line 946 "ext/standard/url_scanner_ex.c"
yy51:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == '>') goto yy50;
@@ -964,9 +965,9 @@ yy55:
goto yy50;
yy56:
++YYCURSOR;
#line 566 "ext/standard/url_scanner_ex.re"
#line 567 "ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
#line 970 "ext/standard/url_scanner_ex.c"
#line 971 "ext/standard/url_scanner_ex.c"
yy58:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -977,11 +978,11 @@ yy59:
}
if (yych >= '(') goto yy55;
++YYCURSOR;
#line 567 "ext/standard/url_scanner_ex.re"
#line 568 "ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
#line 983 "ext/standard/url_scanner_ex.c"
#line 984 "ext/standard/url_scanner_ex.c"
}
#line 570 "ext/standard/url_scanner_ex.re"
#line 571 "ext/standard/url_scanner_ex.re"
stop:
+1
View File
@@ -355,6 +355,7 @@ static int check_http_host(char *target)
char *colon;
if ((tmp = zend_hash_str_find(&EG(symbol_table), ZEND_STRL("_SERVER"))) &&
Z_TYPE_P(tmp) == IS_ARRAY &&
(host = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("HTTP_HOST"))) &&
Z_TYPE_P(host) == IS_STRING) {
host_tmp = zend_string_init(Z_STRVAL_P(host), Z_STRLEN_P(host), 0);
+2 -2
View File
@@ -6,11 +6,11 @@ ARG_ENABLE("zip", "ZIP support", "yes");
if (PHP_ZIP != "no") {
if (CHECK_HEADER_ADD_INCLUDE("zip.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\include;" + PHP_EXTRA_INCLUDES) &&
CHECK_HEADER_ADD_INCLUDE("zipconf.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\lib\\libzip\\include;" + PHP_EXTRA_LIBS + "\\libzip\\include;" + PHP_ZIP) &&
(PHP_ZIP_SHARED && CHECK_LIB("libzip.lib", "zip", PHP_ZIP) || CHECK_LIB("libzip_a.lib", "zip", PHP_ZIP) && CHECK_LIB("libbz2_a.lib", "zip", PHP_ZIP))
(PHP_ZIP_SHARED && CHECK_LIB("libzip.lib", "zip", PHP_ZIP) || CHECK_LIB("libzip_a.lib", "zip", PHP_ZIP) && CHECK_LIB("libbz2_a.lib", "zip", PHP_ZIP) && CHECK_LIB("zlib_a.lib", "zip", PHP_ZIP))
) {
EXTENSION('zip', 'php_zip.c zip_stream.c');
if (get_define("LIBS_ZIP").match("libzip_a.lib")) {
if (get_define("LIBS_ZIP").match("libzip_a(?:_debug)?\.lib")) {
/* Using static dependency lib. */
AC_DEFINE("ZIP_STATIC", 1);
}
+5 -2
View File
@@ -1026,10 +1026,13 @@ static void php_zip_object_free_storage(zend_object *object) /* {{{ */
}
if (intern->za) {
if (zip_close(intern->za) != 0) {
#if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1
php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", "zip_close have failed");
#else
php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", zip_strerror(intern->za));
return;
zip_discard(intern->za);
#endif
}
intern->za = NULL;
}
if (intern->buffers_cnt>0) {
+24
View File
@@ -0,0 +1,24 @@
--TEST--
ZipArchive Bug #76524 (memory leak with ZipArchive::OVERWRITE flag and empty archive)
--SKIPIF--
<?php
if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
$i = 0;
do {
$filename = __DIR__ . "/nonexistent" . ($i++) . ".zip";
} while (file_exists($filename));
$zip = new ZipArchive();
$zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
echo 'ok';
/* Zip-related error messages depend on platform and libzip version,
so the regex is used to check that Zend MM does NOT show warnings
about leaks: */
?>
--EXPECTREGEX--
ok((?!memory leaks detected).)*
+4 -4
View File
@@ -2,7 +2,7 @@
/* edit configure.ac to change version number */
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 2
#define PHP_RELEASE_VERSION 7
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.2.7-dev"
#define PHP_VERSION_ID 70207
#define PHP_RELEASE_VERSION 9
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.2.9"
#define PHP_VERSION_ID 70209
+1 -1
View File
@@ -311,7 +311,7 @@ PW32IO int php_win32_ioutil_mkdir(const char *path, mode_t mode)
int ret = 0;
DWORD err = 0;
if (pathw_len < _MAX_PATH && pathw_len > _MAX_PATH - 12) {
if (pathw_len < _MAX_PATH && pathw_len >= _MAX_PATH - 12) {
/* Special case here. From the doc:
"When using an API to create a directory, the specified path cannot be
+1 -1
View File
@@ -117,7 +117,7 @@ typedef enum {
#define PHP_WIN32_IOUTIL_IS_JUNCTION_PATHW(pathw, path_lenw) (path_lenw >= PHP_WIN32_IOUTIL_JUNCTION_PREFIX_LENW \
&& 0 == wcsncmp((pathw), PHP_WIN32_IOUTIL_JUNCTION_PREFIXW, PHP_WIN32_IOUTIL_JUNCTION_PREFIX_LENW))
#define PHP_WIN32_IOUTIL_IS_ABSOLUTEW(pathw, path_lenw) (PHP_WIN32_IOUTIL_IS_LONG_PATHW(pathw, path_lenw) \
|| path_lenw >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(pathw[0]) && L':' == pathw[1] && IS_SLASHW(pathw[2]))
|| path_lenw >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(pathw[0]) && L':' == pathw[1] && PHP_WIN32_IOUTIL_IS_SLASHW(pathw[2]))
#define PHP_WIN32_IOUTIL_IS_UNC(pathw, path_lenw) (path_lenw >= 2 && PHP_WIN32_IOUTIL_IS_SLASHW(pathw[0]) && PHP_WIN32_IOUTIL_IS_SLASHW(pathw[1]) \
|| path_lenw >= PHP_WIN32_IOUTIL_UNC_PATH_PREFIX_LENW && 0 == wcsncmp((pathw), PHP_WIN32_IOUTIL_UNC_PATH_PREFIXW, PHP_WIN32_IOUTIL_UNC_PATH_PREFIX_LENW))
+38 -9
View File
@@ -29,9 +29,9 @@ DIR *opendir(const char *dir)
DIR *dp;
wchar_t *filespecw, *resolvedw;
HANDLE handle;
int index;
char resolved_path_buff[MAXPATHLEN];
size_t resolvedw_len, filespecw_len;
size_t resolvedw_len, filespecw_len, index;
zend_bool might_need_prefix;
if (!VCWD_REALPATH(dir, resolved_path_buff)) {
return NULL;
@@ -48,7 +48,12 @@ DIR *opendir(const char *dir)
return NULL;
}
might_need_prefix = resolvedw_len >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(resolvedw[0]) && L':' == resolvedw[1] && PHP_WIN32_IOUTIL_IS_SLASHW(resolvedw[2]);
filespecw_len = resolvedw_len + 2;
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
filespecw_len += PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW;
}
filespecw = (wchar_t *)malloc((filespecw_len + 1)*sizeof(wchar_t));
if (filespecw == NULL) {
free(dp);
@@ -56,8 +61,14 @@ DIR *opendir(const char *dir)
return NULL;
}
wcscpy(filespecw, resolvedw);
index = (int)filespecw_len - 1;
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
wcscpy(filespecw, PHP_WIN32_IOUTIL_LONG_PATH_PREFIXW);
wcscpy(filespecw + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, resolvedw);
index = resolvedw_len + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW - 1;
} else {
wcscpy(filespecw, resolvedw);
index = resolvedw_len - 1;
}
if (index >= 0 && filespecw[index] == L'/' || index == 0 && filespecw[index] == L'\\')
filespecw[index] = L'\0';
wcscat(filespecw, L"\\*");
@@ -178,24 +189,42 @@ int rewinddir(DIR *dp)
/* Re-set to the beginning */
wchar_t *filespecw;
HANDLE handle;
int index;
size_t dirw_len, filespecw_len, index;
zend_bool might_need_prefix;
FindClose(dp->handle);
dp->offset = 0;
dp->finished = 0;
filespecw = (wchar_t *)malloc((wcslen((wchar_t *)dp->dirw) + 2 + 1)*sizeof(wchar_t));
/* XXX save the dir len into the struct. */
dirw_len = wcslen((wchar_t *)dp->dirw);
might_need_prefix = dirw_len >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(dp->dirw[0]) && L':' == dp->dirw[1] && PHP_WIN32_IOUTIL_IS_SLASHW(dp->dirw[2]);
filespecw_len = dirw_len + 2;
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
filespecw_len += PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW;
}
filespecw = (wchar_t *)malloc((filespecw_len + 1)*sizeof(wchar_t));
if (filespecw == NULL) {
return -1;
}
wcscpy(filespecw, (wchar_t *)dp->dirw);
index = (int)wcslen(filespecw) - 1;
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
wcscpy(filespecw, PHP_WIN32_IOUTIL_LONG_PATH_PREFIXW);
wcscpy(filespecw + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, dp->dirw);
index = dirw_len + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW - 1;
} else {
wcscpy(filespecw, dp->dirw);
index = dirw_len - 1;
}
if (index >= 0 && (filespecw[index] == L'/' ||
(filespecw[index] == L'\\' && index == 0)))
filespecw[index] = L'\0';
wcscat(filespecw, L"/*");
wcscat(filespecw, L"\\*");
if ((handle = FindFirstFileExW(filespecw, FindExInfoBasic, &(dp->fileinfo), FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH)) == INVALID_HANDLE_VALUE) {
dp->finished = 1;
+5 -3
View File
@@ -66,7 +66,7 @@ void closelog(void)
PW32G(log_source) = INVALID_HANDLE_VALUE;
}
if (PW32G(log_header)) {
efree(PW32G(log_header));
free(PW32G(log_header));
PW32G(log_header) = NULL;
}
}
@@ -112,7 +112,6 @@ void syslog(int priority, const char *message, ...)
efree(tmp);
}
/* Emulator for BSD openlog() routine
* Accepts: identity
* options
@@ -121,11 +120,14 @@ void syslog(int priority, const char *message, ...)
void openlog(const char *ident, int logopt, int facility)
{
size_t header_len;
closelog();
PW32G(log_source) = RegisterEventSource(NULL, "PHP-" PHP_VERSION);
spprintf(&PW32G(log_header), 0, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
header_len = strlen(ident) + 2 + 11;
PW32G(log_header) = malloc(header_len*sizeof(char));
sprintf_s(PW32G(log_header), header_len, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
}
/*