Commit Graph

722 Commits

Author SHA1 Message Date
Anatol Belski
94699d2ade Use suitable datatypes 2018-04-30 14:27:11 +02:00
Anatol Belski
f603ab57fc Reuse the struct timespec based pieces in libmagic 2018-04-30 12:02:47 +02:00
Anatol Belski
cf45479a19 Reuse strcasestr implementation from libmagic 2018-04-29 19:39:57 +02:00
Anatol Belski
09db1ae4b7 Fix C89 compat 2018-04-29 16:18:59 +02:00
Anatol Belski
e2182a1ba7 Port libmagic 5.33 2018-04-29 16:02:08 +02:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso
2d48d734a2 Fix some misspellings 2018-02-06 16:59:00 +01:00
Gabriel Caruso
fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
c6c9e71a5b Add missing SKIPIF sections 2018-02-03 13:54:34 +01:00
Gabriel Caruso
2238403892 Trailing whitespaces on ext/*
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-04 02:38:32 -02:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Anatol Belski
259085f201 Update libmagic.patch, also reflecting PCRE2 changes 2017-12-21 15:47:07 +01:00
Anatol Belski
9408f1efa7 Update libmagic.patch 2017-12-21 15:43:04 +01:00
Anatol Belski
aa978538ca Merge branch 'PHP-7.2'
* PHP-7.2:
  fileinfo: fix misleading indentation in libmagic
2017-12-21 15:42:16 +01:00
Riccardo Magliocchetti
e313daa598 fileinfo: fix misleading indentation in libmagic 2017-12-21 15:39:00 +01:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Nikita Popov
b72b1a4e4d Add zend_object_alloc() API
Using ecalloc() to create objects is expensive, because the
dynamic-size memset() is unreasonably slow. Make sure we only
zero the main object structure with known size, as the properties
are intialized separately anyway.

Technically we do not need to zero the embedded zend_object
structure either, but as long as the memset argument is constant,
a couple more bytes don't really matter.
2017-11-25 17:12:37 +01:00
Anatol Belski
20d930d8f3 Fix remaining signedness warnings 2017-11-14 17:07:09 +01:00
Anatol Belski
a5bc5aed71 Patch core for PCRE2 support
RFC https://wiki.php.net/rfc/pcre2-migration
2017-11-13 19:37:38 +01:00
Anatol Belski
c51bc3814a Merge branch 'PHP-7.2'
* PHP-7.2:
  Update libmagic.patch
2017-10-23 19:18:57 +02:00
Anatol Belski
b4db9e9acc Update libmagic.patch 2017-10-23 19:18:25 +02:00
Anatol Belski
bcad693468 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fail hard when re2c is not found or the version requirement not met
  Fix mismatching alloc
2017-10-23 19:15:43 +02:00
Anatol Belski
fb0be397d0 Fix mismatching alloc 2017-10-23 18:49:17 +02:00
Anatol Belski
cc8a28fb18 Merge branch 'PHP-7.2'
* PHP-7.2:
  It looks like i should've taken joint response on ext/fileinfo long ago
2017-10-11 22:26:09 +02:00
Anatol Belski
81473829d4 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  It looks like i should've taken joint response on ext/fileinfo long ago
2017-10-11 22:25:27 +02: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
Anatol Belski
bfe19cb355 Merge branch 'PHP-7.2'
* PHP-7.2:
  Cleanup irrelevant info
2017-10-11 19:00:41 +02:00
Anatol Belski
747f70ba82 Cleanup irrelevant info 2017-10-11 18:40:16 +02:00
Anatol Belski
b7a5d52e98 Merge branch 'PHP-7.2'
* PHP-7.2:
  Upgrade bundled libmagic to 5.31
2017-10-11 18:24:29 +02:00
Anatol Belski
08d8623dec Upgrade bundled libmagic to 5.31 2017-10-11 18:18:55 +02:00
Peter Kokot
5cf017a132 Remove EXPERIMENTAL files from fileinfo and pdo_odbc stable extensions 2017-09-30 01:58:08 +02:00
Kalle Sommer Nielsen
c34ba92782 Get rid of all these old package[2].xml files, most of these had no had a release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl
OCI, PDO_OCI and zip are left as they are actively developed and released there
2017-08-17 22:09:29 +02:00
Anatol Belski
03383119d2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  remove dup of the binary file, rely on a test runtime copy instead
2017-07-30 17:52:36 +02:00
Anatol Belski
eab66f9068 remove dup of the binary file, rely on a test runtime copy instead 2017-07-30 17:51:27 +02:00
Dmitry Stogov
71daef93bc preg_replace() optimization 2017-06-07 13:50:16 +03:00
Xinchen Hui
2d21404e25 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c)
  Missed NEWS

Conflicts:
	ext/fileinfo/libmagic.patch
2017-04-10 11:47:38 +08:00
Xinchen Hui
c32281d406 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c)
2017-04-10 11:44:50 +08:00
Xinchen Hui
341ff7119f Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c) 2017-04-10 11:44:41 +08:00
Anatol Belski
703c9ee1a4 sync libmagic.patch 2017-01-05 23:32:30 +01:00
Anatol Belski
b11383fbde revert year change on bundled lib files 2017-01-05 23:26:20 +01:00
Anatol Belski
8892783649 add missing condition 2017-01-05 23:16:09 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
895a82695c Merge branch 'PHP-7.1'
* PHP-7.1:
  add test for bug #57547
2016-11-24 19:28:56 +01:00
Anatol Belski
c26e96a05d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  add test for bug #57547
2016-11-24 19:27:50 +01:00
Anatol Belski
a36dd1dfd8 add test for bug #57547 2016-11-24 19:25:47 +01:00
Anatol Belski
99c7ad7aa8 add test for FILEINFO_EXTENSION flag 2016-11-24 18:05:11 +01:00
Anatol Belski
52f5b9659f Add test for bug #67516 2016-11-24 17:59:09 +01:00
Anatol Belski
4c00c5ebed fix test 2016-11-24 17:44:05 +01:00
Anatol Belski
31a3956053 apply the current Fedora's data patches 2016-11-24 17:43:16 +01:00
Anatol Belski
5f4699c0ca fix c/p mistake 2016-11-24 16:41:57 +01:00
Anatol Belski
6b14989001 catch up with new finfo constant 2016-11-24 16:23:35 +01:00
Anatol Belski
020b87a40d update libmagic.patch 2016-11-24 14:58:54 +01:00
Anatol Belski
0e9912dc6f maintain patch level 2016-11-24 14:56:30 +01:00
Anatol Belski
918e626338 the vanilla data is used for now, seems everything is incorporated 2016-11-24 14:50:55 +01:00
Anatol Belski
3ef069d26c more fileinfo test fixes
Note the behavior change, FILEINFO_CONTINUE will now always
append a string \012-. I'm leaving this as is for now, as this is
the behavior change in libmagic.
2016-11-24 14:48:33 +01:00
Anatol Belski
c62b732696 fix tests 2016-11-24 14:36:49 +01:00
Anatol Belski
411e97c72d Upgraded libmagic to 5.29
yet unfinished port to libmagic 5.28

catch with missing libmagic port pieces

regenerate data file with magic from 5.28

test magic files from 5.28

missing files

fix path

pure c99 is still not supported

move right to 5.29, yet some bugs present

more sync with orig lib

more ZMM usage

use unpatched data for now

partial revert according to bug #67705

Revert "more ZMM usage"

This reverts commit 5e3c9b851034b455942b219b18bdc49c8315c3ee.

several fixes, so it's now closer to the clean port
2016-11-24 13:44:04 +01:00
Christoph M. Becker
e8d8169fc1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-08 18:51:34 +02:00
Christoph M. Becker
9d03310b23 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-08 18:45:27 +02:00
Christoph M. Becker
243d5fcb1f Add test for bug #69107: finfo no longer detects PHP files 2016-08-08 18:43:33 +02:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Anatol Belski
3d3f11ede4 Fixed the UTF-8 and long path support in the streams on Windows.
Since long the default PHP charset is UTF-8, however the Windows part is
out of step with this important point. The current implementation in PHP
doesn't technically permit to handle UTF-8 filepath and several other
things. Till now, only the ANSI compatible APIs are being used. Here is more
about it

https://msdn.microsoft.com/en-us/library/windows/desktop/dd317752%28v=vs.85%29.aspx

The patch fixes not only issues with multibyte filenames under
incompatible codepages, but indirectly also issues with some other multibyte
encodings like BIG5, Shift-JIS, etc. by providing a clean way to access
filenames in UTF-8. Below is a small list of issues from the bug tracker,
that are getting fixed:

https://bugs.php.net/63401
https://bugs.php.net/41199
https://bugs.php.net/50203
https://bugs.php.net/71509
https://bugs.php.net/64699
https://bugs.php.net/64506
https://bugs.php.net/30195
https://bugs.php.net/65358
https://bugs.php.net/61315
https://bugs.php.net/70943
https://bugs.php.net/70903
https://bugs.php.net/63593
https://bugs.php.net/54977
https://bugs.php.net/54028
https://bugs.php.net/43148
https://bugs.php.net/30730
https://bugs.php.net/33350
https://bugs.php.net/35300
https://bugs.php.net/46990
https://bugs.php.net/61309
https://bugs.php.net/69333
https://bugs.php.net/45517
https://bugs.php.net/70551
https://bugs.php.net/50197
https://bugs.php.net/72200
https://bugs.php.net/37672

Yet more related tickets can for sure be found - on bugs.php.net, Stackoverflow
and Github. Some of the bugs are pretty recent, some descend to early
2000th, but  the user comments in there last even till today. Just for example,
bug #30195 was opened in 2004, the latest comment in there was made in 2014. It
is certain, that these bugs descend not only to pure PHP use cases, but get also
redirected from the popular PHP based projects. Given the modern systems (and
those supported by PHP) are always based on NTFS, there is no excuse to keep
these issues unresolved.

The internalization approach on Windows is in many ways different from
UNIX and Linux, while it supports and is based on Unicode. It depends on the
current system code page, APIs used and exact kind how the binary was compiled
The locale doesn't affect the way Unicode or ANSI API work. PHP in particular
is being compiled without _UNICODE defined and this is conditioned by the
way we handle strings. Here is more about it

https://msdn.microsoft.com/en-us/library/tsbaswba.aspx

However, with any system code page ANSI functions automatically convert
paths to UTF-16. Paths in some encodings incompatible with the
current system code page, won't work correctly with ANSI APIs. PHP
till now only uses the ANSI Windows APIs.

For example, on a system with the current code page 1252, the paths
in cp1252 are supported and transparently converted to UTF-16 by the
ANSI functions. Once one wants to handle a filepath encoded with cp932 on
that particular system, an ANSI or a POSIX compatible function used in
PHP will produce an erroneous result. When trying to convert that cp932 path
to UTF-8 and passing to the ANSI functions, an ANSI function would
likely interpret the UTF-8 string as some string in the current code page and
create a filepath that represents every single byte of the UTF-8 string.
These behaviors are not only broken but also disregard the documented
INI settings.

This patch solves the issies with the multibyte paths on Windows by
intelligently enforcing the usage of the Unicode aware APIs. For
functions expect Unicode (fe CreateFileW, FindFirstFileW, etc.), arguments
will be converted to UTF-16 wide chars. For functions returning Unicode
aware data (fe GetCurrentDirectoryW, etc.), resulting wide string is
converted back to char's depending on the current PHP charset settings,
either to the current ANSI codepage (this is the behavior prior to this patch)
or to UTF-8 (the default behavior).

In a particular case, users might have to explicitly set
internal_encoding or default_charset, if filenames in ANSI codepage are
necessary. Current tests show no regressions and witness that this will be an
exotic case, the current default UTF-8 encoding is compatible with any
supported system. The dependency libraries are long switching to Unicode APIs,
so some tests were also added for extensions not directly related to streams.
At large, the patch brings over 150 related tests into the core. Those target
and was run on various environments with European, Asian, etc. codepages.
General PHP frameworks was tested and showed no regressions.

The impact on the current C code base is low, the most places affected
are the Windows only places in the three files tsrm_win32.c, zend_virtual_cwd.c
and plain_wrapper.c. The actual implementation of the most of the wide
char supporting functionality is in win32/ioutil.* and win32/codepage.*,
several  low level functionsare extended in place to avoid reimplementation for
now. No performance impact was sighted. As previously mentioned, the ANSI APIs
used prior the patch perform Unicode conversions internally. Using the
Unicode  APIs directly while doing custom conversions just retains the status
quo. The ways to optimize it are open (fe. by implementing caching for the
strings converted to wide variants).

The long path implementation is user transparent. If a path exceeds the
length of _MAX_PATH, it'll be automatically prefixed with \\?\. The MAXPATHLEN
is set to 2048 bytes.

Appreciation to Pierre Joye, Matt Ficken, @algo13 and others for tips, ideas
and testing.

Thanks.
2016-06-20 12:45:39 +02:00
Anatol Belski
44c219b0b4 Merge branch 'PHP-7.0'
* PHP-7.0:
  fix borked mainstream patch
  5.5.35 now
2016-03-31 01:38:38 +02:00
Anatol Belski
e6bb7eb3aa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix borked mainstream patch
  5.5.35 now
2016-03-31 01:38:22 +02:00
Anatol Belski
a00c2b1bf5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix borked mainstream patch
  5.5.35 now
2016-03-31 01:36:47 +02:00
Anatol Belski
4b0b1cec00 fix borked mainstream patch 2016-03-31 01:33:38 +02:00
Anatol Belski
26ed2f3610 Merge branch 'PHP-7.0'
* PHP-7.0:
  fix test to not to cause false positives
  Align NEWS entry format
  Align NEWS entry format
2016-03-31 01:30:50 +02:00
Anatol Belski
9dc6c33740 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test to not to cause false positives
2016-03-31 01:30:23 +02:00
Anatol Belski
ed707a5217 fix test to not to cause false positives 2016-03-31 01:29:05 +02:00
Anatol Belski
5272184a1e Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
The actual fix is applying the upstream patch from
6713ca45e7
2016-03-29 13:11:25 +02:00
Anatol Belski
84990ab346 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
2016-03-29 13:11:17 +02:00
Anatol Belski
fe13566c93 Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
The actual fix is applying the upstream patch from
6713ca45e7
2016-03-29 13:10:39 +02:00
Anatol Belski
d1ac9edc50 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  Updated to version 2016.3 (2016c)
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
  Fix bug #71798 - Integer Overflow in php_raw_url_encode
  update NEWS
  Disable huge pages in the Zend allocator by default As per the discussion on internals, this is an expert feature that needs special system-level configuration and care.
  Added ability to disable huge pages in Zend Memeory Manager through the environment variable USE_ZEND_ALLOC_HUGE_PAGES=0.
  Fix bug #71860: Require valid paths for phar filenames
  Fix bug #71860: Require valid paths for phar filenames
  update NEWS
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
  Merge branch 'PHP-5.6' into PHP-7.0
  Updated to version 2016.2 (2016b)
  update libs versions
  set RC1 versions
  Going for 5.5.34
2016-03-29 11:27:39 +02:00
Anatol Belski
e93c6910fc Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
The actual fix is applying the upstream patch from
6713ca45e7
2016-03-28 00:45:19 +02:00
Nikita Popov
565f6bd374 Merge branch 'PHP-7.0' 2016-03-02 00:38:33 +01:00
Nikita Popov
726e87e142 Merge branch 'PHP-5.6' into PHP-7.0 2016-03-02 00:37:40 +01:00
Nikita Popov
471540d285 Fix intermittent failure of bug_68819_002.phpt
The test used rand(32, 127) to select the character, however
chr(127) results in "data" instead of the expected result, so this
test would fail in something like 1% of the runs.

Replace rand() with fixed character "a".
2016-03-02 00:34:36 +01:00
Nikita Popov
93dc91b386 Remove version checks
PHP_VERSION_ID
PHP_API_VERSION
ZEND_MODULE_API_NO
PHP_MAJOR_VERSION, PHP_MINOR_VERSION
ZEND_ENGINE_2

I've left litespeed alone, as it seems to genuinely maintain support
for many PHP versions.
2016-01-30 15:35:28 +01:00
Xinchen Hui
b68d525f16 Update libmagic.patch for PHP-7.0 2016-01-25 11:45:32 +08:00
Xinchen Hui
4cb47bd3bd Fixed compiler warnings 2016-01-25 11:45:14 +08:00
Xinchen Hui
da7f42de38 Fixed bug #71434 (finfo throws notice for specific python file) 2016-01-25 11:40:08 +08:00
Xinchen Hui
47e7662a13 Update libmagic.patch for PHP-5.6 2016-01-25 11:25:04 +08:00
Xinchen Hui
a458a4fdc1 Fixed bug #7143 (finfo throws notice for specific python file)
There seems be a bug while it was changed from regexec to
preg_match_impl:
https://github.com/php/php-src/commit/46906925#diff-56e765972d18c84894ea061cfe58076aR1757
2016-01-25 11:24:44 +08:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Anatol Belski
545b364d56 remove TSRMLS_*
either remains or merged in from PHP5
2015-08-02 13:42:01 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Aaron Piotrowski
110e0a5a2c Merge branch 'master' into throwable-interface
# Conflicts:
#	Zend/zend_language_scanner.c
#	Zend/zend_language_scanner.l
#	ext/simplexml/tests/SimpleXMLElement_xpath.phpt
2015-06-14 18:53:11 -05:00
Anatol Belski
c444c4172f further cleanups with S_IF* macros generalized declarations 2015-05-25 18:03:28 +02:00
Aaron Piotrowski
64b167d201 Updated tests to reflect exception class changes. 2015-05-16 16:49:14 -05:00
Anatol Belski
63c92a6e96 fix test 2015-04-14 15:24:46 +02:00
Anatol Belski
bc63491da8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2015-04-14 15:21:47 +02:00
Anatol Belski
3803bbde24 fix test 2015-04-14 15:20:44 +02:00
Dmitry Stogov
753fa0c593 Partial revert of 1a7798c786 that introduced wrong memory access 2015-04-14 15:35:33 +03:00
Stanislav Malyshev
b3709bfc52 Merge branch 'PHP-5.6'
* PHP-5.6: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	Zend/zend_exceptions.c
	ext/curl/interface.c
	ext/dom/document.c
	ext/fileinfo/libmagic/softmagic.c
	ext/gd/gd.c
	ext/hash/hash.c
	ext/pgsql/pgsql.c
	ext/phar/phar.c
	ext/phar/phar_internal.h
	ext/standard/http_fopen_wrapper.c
	ext/standard/link.c
	ext/standard/streamsfuncs.c
	ext/xmlwriter/php_xmlwriter.c
	ext/zlib/zlib.c
2015-04-14 01:28:06 -07:00
Stanislav Malyshev
5776fceb16 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
2015-04-14 01:05:01 -07:00
Stanislav Malyshev
0cb9d75cb6 Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  Fixed bug #68901 (use after free)
  Fixed bug #68740 (NULL Pointer Dereference)
  Fix bug #66550 (SQLite prepared statement use-after-free)
  Better fix for #68601 for perf 81e9a993f2
  Fix bug #68601 buffer read overflow in gd_gif_in.c
  Revert "Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4"
  Fixed bug #69293
  Add ZEND_ARG_CALLABLE_INFO to allow internal function to type hint against callable.
2015-04-11 16:56:12 -07:00
Stanislav Malyshev
4435b9142f Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) 2015-04-11 16:53:22 -07:00
Stanislav Malyshev
f938112c49 Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault) 2015-04-11 16:53:21 -07:00
Nikita Popov
122d759618 Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
2015-04-06 11:27:34 +02:00
Anatol Belski
a0eaa37afe missing includes 2015-04-01 13:39:25 +02:00
Dmitry Stogov
1018f462d8 Patch improvement:
Removed the corresponding core code.
Fixed ext/com_dotnet and ext/date.
Refactored ext/intl changes.
Improved ext/fileinfo and ext/pdo changes.
Fixed tests.
2015-03-30 18:53:38 +03:00
Dmitry Stogov
9155a267ad Merge branch 'InternalClassClean' of github.com:Danack/php-src into InternalClassClean
* 'InternalClassClean' of github.com:Danack/php-src:
  Fixed indentation. Fixed comment style. Fixed commented out code.
  Reverted change to function name and added note of why it is different from the class it is actually changing.
  Made UConverter throw an exception if the constructor fails.
  Fixed PDO constructor to not return null.
  Fixed fileinfo behaviour.
  Made Phar throw exception on bad constructor.
  Converted intl extension to use IntlException in constructors.
  Fixed SplFixedArray and tests.
  Fixed ReflectionExtension and ReflectionProperty.
  Fixed ReflectionFunction, ReflectionMethod and ReflectionParameter.
  Fixed PDORow behaviour and message.
2015-03-30 12:14:43 +03:00
Anatol Belski
a7e6687df6 updated libmagic.patch 2015-03-29 18:22:42 +02:00
Anatol Belski
5b6427c40f further sync with libmagic.orig 2015-03-29 18:17:02 +02:00
Anatol Belski
f51d78a35d catch up with libmagic.orig
that'll simplify future merges
2015-03-29 18:11:11 +02:00
Anatol Belski
662c439087 fix typo 2015-03-29 17:59:28 +02:00
Anatol Belski
5e773b4ce5 catch up with libmagic.orig 2015-03-29 17:57:22 +02:00
Anatol Belski
a935c02210 added test for bug #69320 2015-03-29 17:52:38 +02:00
Anatol Belski
aeabea4aa9 Fixed bug #69320 libmagic crash when running laravel tests
Basically reverted the part of the new patch to what we have in 5.6
as the current change seems to have bad side effects. Hovere the
in buffer used for PCRE is still doubled (1 << 14), this might or
might not be optimal, so lets observe.
2015-03-29 17:42:59 +02:00
Kalle Sommer Nielsen
0ca8ffa2b8 Forgot this one in the last commit, removes old VC support from ext/fileinfo 2015-03-29 07:54:18 +02:00
Kalle Sommer Nielsen
88b9d485d6 Drop old VC support for ext/fileinfo.
@Anatol, I generated the updated patch file against file 5.22, since you are the one that usually updates it, can you please confirm it works?
2015-03-29 07:48:48 +02:00
Danack
78ebf83ad3 Fixed fileinfo behaviour. 2015-03-15 14:54:49 +00:00
Anatol Belski
11716401bd fix possible unititialized pointer usage 2015-03-12 13:00:36 +01:00
Anatol Belski
d5558138d7 partially revert wrong merge 2015-03-08 20:05:34 +01:00
Anatol Belski
bae44417a8 after merge fix 2015-03-08 19:56:31 +01:00
Anatol Belski
12babf59c1 updated libmagic.patch 2015-03-08 19:48:05 +01:00
Anatol Belski
316b1e0267 catching up 2015-03-08 19:48:01 +01:00
Anatol Belski
3e8a5485e2 catching up 2015-03-08 19:47:59 +01:00
Anatol Belski
eeb74b0ab8 regenerated data file 2015-03-08 19:47:53 +01:00
Anatol Belski
f54cf1ec57 more after patch fixes 2015-03-08 19:47:50 +01:00
Anatol Belski
1ebe527757 restore good patch parts 2015-03-08 19:47:48 +01:00
Anatol Belski
75a1392fb5 stat is done by php 2015-03-08 19:47:42 +01:00
Anatol Belski
49dc53722b use zend_strndup 2015-03-08 19:47:41 +01:00
Anatol Belski
1b77e51ad7 started to patch for libmagic.next
everything is broken yet
2015-03-08 19:47:38 +01:00
Anatol Belski
332bbfa23b fix test outputs 2015-03-08 19:47:34 +01:00
Anatol Belski
9603f16f99 catch up with the previous cve-2014-3538 patch 2015-03-08 19:47:33 +01:00
Anatol Belski
f39a8517e0 catching up 2015-03-08 19:47:31 +01:00
Anatol Belski
5892ec175a catching up 2015-03-08 19:47:30 +01:00
Anatol Belski
ca98547801 catching up 2015-03-08 19:47:28 +01:00
Anatol Belski
ef51790f61 updated the test magic file 2015-03-08 19:47:27 +01:00
Anatol Belski
7022fe80f7 add patchlevel info 2015-03-08 19:47:25 +01:00
Anatol Belski
ec84d36c9f portable off_t 2015-03-08 19:47:24 +01:00
Anatol Belski
969ce2e877 regenerated data file 2015-03-08 19:47:21 +01:00
Anatol Belski
0d410fc2d2 more after patch fixes 2015-03-08 19:47:20 +01:00
Anatol Belski
1a7798c786 restore good patch parts 2015-03-08 19:47:18 +01:00
Anatol Belski
9e3be05e32 missing prototype 2015-03-08 19:47:17 +01:00
Anatol Belski
9b1bdccb04 libmagic.patch so far 2015-03-08 19:47:15 +01:00
Anatol Belski
0dd82374d1 updated test magic file 2015-03-08 19:47:14 +01:00
Anatol Belski
2fd282a690 use right memory api 2015-03-08 19:47:12 +01:00
Anatol Belski
f3fad68efd stat is done by php 2015-03-08 19:47:11 +01:00
Anatol Belski
a1883a8523 use zend_strndup 2015-03-08 19:47:09 +01:00
Anatol Belski
2181ed2e2a started to patch for libmagic.next
everything is broken yet
2015-03-08 19:47:06 +01:00
Reeze Xia
2b396a8092 Update libmagic.patch to reflect changes made 2015-02-10 20:48:58 +08:00
Dmitry Stogov
4241a090ad Avoid reallocation in preg_replace() if nothing was replaced 2015-02-10 13:30:25 +03:00
Anatol Belski
ce9f52adcd Merge branch 'PHP-5.6'
* PHP-5.6:
  moved the part of the test into an appropriate place
2015-02-08 14:13:39 +01:00
Anatol Belski
979020fcad moved the part of the test into an appropriate place 2015-02-08 14:10:52 +01:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Xinchen Hui
942809909e Cleanup resource handling APIs 2015-02-02 13:23:16 +08:00
Anatol Belski
d2a4940bd2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #68731 finfo_buffer doesn't extract the correct mime with some gifs
2015-01-22 12:28:11 +01:00
Anatol Belski
093a23d1c4 Fixed bug #68731 finfo_buffer doesn't extract the correct mime with some gifs
The fix for bug #67647 applies here, too.
2015-01-22 12:26:50 +01:00
Anatol Belski
ccffa2aad1 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67647 Bundled libmagic 5.17 does not detect quicktime files correctly

Conflicts:
	ext/fileinfo/data_file.c
2015-01-22 11:56:34 +01:00
Anatol Belski
c9d0894ec5 Fixed bug #67647 Bundled libmagic 5.17 does not detect quicktime files correctly 2015-01-22 11:48:11 +01:00
Anatol Belski
f9d672f7d4 Merge branch 'PHP-5.6'
* PHP-5.6:
  simplify error handling for dirs as magic
2015-01-22 10:17:45 +01:00
Anatol Belski
60c2621b2a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  simplify error handling for dirs as magic
2015-01-22 10:17:14 +01:00
Anatol Belski
43652d386a simplify error handling for dirs as magic 2015-01-22 10:16:13 +01:00
Anatol Belski
4e3e95dfc0 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #68827 Double free with disabled ZMM
2015-01-22 10:02:05 +01:00
Anatol Belski
d0e75bdc59 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68827 Double free with disabled ZMM
  Fixed segfault while running with moodle
2015-01-22 10:00:10 +01:00
Joshua Rogers
91aa340180 Fixed bug #68827 Double free with disabled ZMM 2015-01-22 09:59:13 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
4d6fb5e684 updated libmagic.patch 2015-01-04 17:09:06 +01:00
Anatol Belski
03ae6f22b6 updated libmagic.patch in 5.6 2015-01-04 17:07:32 +01:00
Anatol Belski
4ed261870f updated libmagic.patch in 5.5 2015-01-04 17:05:42 +01:00
Anatol Belski
ebb98e7aeb updated libmagic.patch in 5.4 2015-01-04 17:04:13 +01:00
Anatol Belski
723319813b Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #68735 fileinfo out-of-bounds memory access
2015-01-04 14:25:28 +01:00
Anatol Belski
28e44f9d44 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #68735 fileinfo out-of-bounds memory access
2015-01-04 14:23:56 +01:00
Anatol Belski
5fe54dbaf9 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #68735 fileinfo out-of-bounds memory access
2015-01-04 14:22:37 +01:00
Anatol Belski
ede59c8feb Fixed bug #68735 fileinfo out-of-bounds memory access 2015-01-04 14:20:21 +01:00
Anatol Belski
c06f66563a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  removed dead code

Conflicts:
	ext/fileinfo/libmagic/readelf.c
	ext/fileinfo/libmagic/readelf.h
2015-01-04 09:42:46 +01:00
Anatol Belski
b644dcfb72 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  removed dead code
2015-01-04 09:40:56 +01:00
Remi Collet
919abf0cb1 removed dead code 2015-01-04 09:40:19 +01:00
Anatol Belski
fa0b5e2c6d updated libmagic.patch 2014-12-30 20:28:13 +01:00
Anatol Belski
ce6cbb3110 updated libmagic.patch 2014-12-30 20:22:51 +01:00
Anatol Belski
99162b8198 updated libmagic.patch 2014-12-30 20:21:28 +01:00
Anatol Belski
a78eaddbe0 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #68671 incorrect expression in libmagic

Conflicts:
	ext/fileinfo/libmagic/print.c
2014-12-30 19:41:07 +01:00
Anatol Belski
091ea62262 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68671 incorrect expression in libmagic
2014-12-30 19:38:08 +01:00
Anatol Belski
d92a87d7cb Fixed bug #68671 incorrect expression in libmagic 2014-12-30 19:37:27 +01:00
Anatol Belski
ef89ab2f99 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWs
  Fixed bug #68665 (Invalid free)
2014-12-28 14:02:25 +01:00
Anatol Belski
a72cd07f29 Fixed bug #68665 (Invalid free) 2014-12-28 13:58:01 +01:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Remi Collet
f0f51da936 drop dead/unused code 2014-12-09 11:25:53 +01:00
Anatol Belski
aa52fcf179 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #68398 msooxml matches too many archives
2014-12-06 20:51:41 +01:00
Anatol Belski
41a2f7074d Fixed bug #68398 msooxml matches too many archives 2014-12-06 20:51:00 +01:00
Veres Lajos
06fdf359e3 typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-23 14:52:47 -08:00
Veres Lajos
4dc994571d typo fixes - https://github.com/vlajos/misspell_fixer
Conflicts:
	ext/ftp/ftp.h
	ext/pcre/pcrelib/pcre_printint.c
	ext/pcre/pcrelib/sljit/sljitLir.c
	ext/pcre/pcrelib/sljit/sljitLir.h
	ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
	ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
	ext/pgsql/pgsql.c
	ext/phar/func_interceptors.c
	ext/soap/soap.c
	ext/standard/image.c
2014-11-23 14:33:43 -08:00
Anatol Belski
71a653452f updated libmagic.patch in master 2014-10-25 12:06:17 +02:00
Anatol Belski
7e5bd4ec69 updated libmagic.patch in 5.6 2014-10-25 12:03:49 +02:00
Anatol Belski
270df3ffd6 updated libmagic.patch in 5.5 2014-10-25 12:01:58 +02:00