Commit Graph

10793 Commits

Author SHA1 Message Date
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
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
Nikita Popov
787593b708 Fix test after serialization change
And move it to a more appropriate location.
2018-07-02 17:58:26 +02:00
Nikita Popov
c793885b76 Fixed bug #74670
Validate that "C" serialization payload is followed by "}" prior to
calling the unserialize() handler. This mitigates issues caused by
unserialize() not correctly handling strings that are not NUL
terminated. Making sure that there is a "}" at the end avoids the
problem.
2018-07-02 17:27:43 +02:00
Christoph M. Becker
ae04110032 Fix #71848: getimagesize with $imageinfo returns false
Some JFIF images contain empty APP segments, i.e. those which consist
only of the marker bytes and the length, but without actual content.
It appears to be doubtful to have empty APP segments, but we should
apply the robustness principle, and accept these, instead of simply
failing in this case.

We choose to add empty APP segments to $imageinfo with an empty string
as value, instead of NULL, or even to omit these segments altogether.

This patch also fixes the potential issue that php_stream_read() might
not read the supposed number of bytes, which could result in garbage to
be added to the read value.
2018-06-30 16:29:30 +02:00
Xinchen Hui
6531719da5 Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys) 2018-06-21 17:26:05 +08:00
Stanislav Malyshev
73bf238507 Fix bug #76390 - do not allow invalid strings in range() 2018-06-04 22:44:05 -07:00
Bob Weinand
97a8483143 Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT) 2018-05-28 00:48:35 +02:00
Joe Watkins
be11b354f4
fix phpdbg disabling chroot support 2018-05-23 22:23:13 +02:00
Anatol Belski
9b8d8cac04 Fixed bug #76335 "link(): Bad file descriptor" with non-ASCII path 2018-05-14 10:43:11 +02:00
Gabriel Caruso
bb79e5764b Fix arginfo for array_replace(_recursive) and array_merge(_recursive) 2018-04-13 15:27:16 +02:00
TATAR Balazs Janos
ac4d9fd055
Fixed #75996: Add the right urls to the header of mt_rand. 2018-03-27 22:09:08 +02:00
Anatol Belski
dfc07f038b Sync test with newer output
Czech Republic vs. newer Czechia
2018-03-16 18:54:55 +01:00
Anatol Belski
8417a23973 Fixed bug #76068 parse_ini_string fails to parse "[foo]\nbar=1|>baz" with segfault 2018-03-10 11:18:21 +01:00
Nikita Popov
fd5bd37ab1 Revert "Fixed bug #75961 (Strange references behavior)"
This reverts commit 94e9d0a2ae.

This code needs to be mindful about modifications to the array
happening during callback execution. It was written in a way that
only accessed the reference, which is guaranteed not to move. The
changed implementation instead accesses the array slot, leading to
use-after-free.

Run ext/standard/tests/array/bug61967.phpt under valgrind to see
the issue.
2018-03-05 15:32:21 +01:00
Stanislav Malyshev
a6f7760d57 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #75981: prevent reading beyond buffer start
2018-02-26 22:26:50 -08:00
Stanislav Malyshev
dde7a05978 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #75981: prevent reading beyond buffer start
2018-02-26 22:26:26 -08:00
Stanislav Malyshev
523f230c83 Fix bug #75981: prevent reading beyond buffer start 2018-02-26 22:25:51 -08:00
Gabriel Caruso
0b8cfa6c78 Fix some arginfos
* all arguments for ftp_pasv are required
* $varname for getenv function isn't required anymore
* fsockopen and pfsockopen only require $hostname
* strtok can work with only one parameter
* strpbrk needs two parameters to work
* required parameters and add some parameters in openssl_* functions
2018-02-23 11:27:14 +01:00
Xinchen Hui
94e9d0a2ae Fixed bug #75961 (Strange references behavior) 2018-02-17 16:33:15 +08:00
Michael Wallner
42f2ae0572
fix bug #75916 DNS_CAA record results contain garbage
It is assumed that DNS_CAA record values are zero terminated,
while its length is defined as (RDATA_LENGTH - tag_length - 2).
2018-02-05 09:04:07 +01:00
Xinchen Hui
6da44fefb2 Fixed bug #75781 (substr_count incorrect result) 2018-01-09 16:21:02 +08:00
Lior Kaplan
fbfdd1e1c4 Happy new year (Update copyright to 2018) 2018-01-02 23:42:29 +02:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Anatol Belski
4c0af1fbd4 Fixed bug #75679 Path 260 character problem 2017-12-14 16:16:50 +01:00
johnstevenson
6ed242dfc8 Fixed #73124: php_ini_scanned_files()
Additional ini files are reported using the --ini option, but not by
`php_ini_scanned_files()`, which relied on PHP_CONFIG_FILE_SCAN_DIR.
2017-11-28 23:33:48 +01:00
Remi Collet
2b07102897 better fix for #75514 2017-11-28 17:42:43 +01:00
Anatol Belski
06202f0feb Fix allocation 2017-11-27 21:18:08 +01:00
Anatol Belski
2868ff84df Fix memory leak 2017-11-27 20:24:30 +01:00
Anatol Belski
2b7d283cc5 Fixed bug #75574 putenv does not work properly if parameter contains non-ASCII unicode character 2017-11-27 18:49:02 +01:00
krakjoe
5a7459a082
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #75409
2017-11-22 04:30:59 +00:00
Scott
269d160159
Fix bug #75409 2017-11-22 04:26:54 +00:00
Nikita Popov
092d0922ea Merge branch 'PHP-7.0' into PHP-7.1 2017-11-17 23:21:48 +01:00
Nikita Popov
0e097f2c96 Fixed bug #75535
The sizeof()s for Content-Length and Transfer-Encoding were missing
the trailing ":". Apart from being generally wrong, this no longer
verified that the header actually contains a colon, leading to the
null http_header_value being used.

Additionally, in the interest of being defensive, also make sure
that http_header_value is non-null by setting it to the end of
the header line (effectively an empty string) if there is no colon.
If the following conditions are correct, this value is not going
to be used though.
2017-11-17 23:18:05 +01:00
Remi Collet
e704e1e8c2 Fixed bug #75514 mt_rand returns value outside [$min,$max]+ on 32-bit 2017-11-13 10:21:46 +01:00
Xinchen Hui
c718fd16a1 Avoid overflow 2017-11-13 11:18:56 +08:00
Xinchen Hui
1c1df0d937 Fixed bug #75511 (fread not free unused buffer) 2017-11-13 11:13:27 +08:00
Anatol Belski
677cd85cb7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  It looks like i should've taken joint response on ext/fileinfo long ago
2017-10-11 22:24:52 +02:00
Anatol Belski
23e97b0222 It looks like i should've taken joint response on ext/fileinfo long ago 2017-10-11 22:21:34 +02:00
Sara Golemon
ac1fd769ad Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS
2017-10-07 10:13:54 -04:00
Sara Golemon
843e492c68
Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS 2017-10-07 10:08:34 -04:00
Anatol Belski
72c008f945 Fix mkdir() special case for path length < 260 and > 248 2017-09-28 13:18:31 +02:00
Joe Watkins
2dd77456fe
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #75220 - Segfault when calling is_callable on parent
2017-09-27 06:08:01 +01:00
Nester
a680d701ce
Fixed #75220 - Segfault when calling is_callable on parent 2017-09-27 06:07:24 +01:00
Anatol Belski
fcad6a97b8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix test failure on 32-bit
2017-09-12 18:18:44 +02:00
Anatol Belski
7674b5e574 Fix test failure on 32-bit 2017-09-12 18:17:28 +02:00
Anatol Belski
d33194d2aa Fix test portability
The message comes from the C runtime, so it is not reliable to check the
exact wording.
2017-09-11 12:38:20 +02:00
Xinchen Hui
6b2813c3a7 Fixed bug #75152 (signed integer overflow in parse_iv) 2017-09-11 12:46:11 +08:00
Remi Collet
c449057808 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  From documentation, only the sign of returned value is relevant
2017-08-24 10:29:44 +02:00
Remi Collet
b7e96f8e0e From documentation, only the sign of returned value is relevant
With recent glibc, memcmp sometime return a negative value instead of -1
2017-08-24 10:27:38 +02:00