1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Commit Graph

51 Commits

Author SHA1 Message Date
George Peter Banyard 457380cae7 Drop wchar header check as always defined since C95 2020-03-31 00:14:56 +02:00
Nikita Popov d4ba1fd963 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #74170: locale information change after mime_content_type
2019-12-20 11:24:03 +01:00
Sergei Turchanov c62cd9a43a Fix #74170: locale information change after mime_content_type
Some functions in libmagic (distributed with fileinfo extension) perform this sequence of calls:
func() {
setlocale(LC_TYPE, "C")
.. do some work ..
setlocale(LC_TYPE, "")
}

It effectively resets LC_TYPE if it that was set before the function call.

To avoid manipulations with current locale at all, the problematic functions
were modified to use locale-independent functions.
2019-12-20 11:22:59 +01:00
Peter Kokot f002761e08 Update libmagic patch
This simplifies the libmagic patch:
- in upstream the HAVE_STRERROR check has been removed
- in upstream library the HAVE_SIGNAL_H has been removed
- indentations syncs with the upstream library
- some irrelevant changes removed from the patch (log comment), upstream
  has this correctly logged already so no need to patch the comment.

Closes GH-4298
2019-07-08 12:38:47 +02:00
Anatol Belski 622b10f06e Ported limagic 5.37 2019-05-30 02:22:40 +02:00
Fabien Villepinte b6f9ade9f2 Remove unused variables 2019-03-17 23:29:51 +01:00
Anatol Belski 29dcf19f8b Declare function proto in header 2018-11-05 21:29:35 +01:00
Anatol Belski e1af7a794a Fix possible stack buffer overflow 2018-08-04 16:56:08 +02:00
Dmitry Stogov 5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski 94699d2ade Use suitable datatypes 2018-04-30 14:27:11 +02:00
Anatol Belski e2182a1ba7 Port libmagic 5.33 2018-04-29 16:02:08 +02: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 08d8623dec Upgrade bundled libmagic to 5.31 2017-10-11 18:18:55 +02:00
Dmitry Stogov 71daef93bc preg_replace() optimization 2017-06-07 13:50:16 +03: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
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 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
https://github.com/file/file/commit/6713ca45e7757297381f4b4cdb9cf5e624a9ad36
2016-03-29 13:10: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
https://github.com/file/file/commit/6713ca45e7757297381f4b4cdb9cf5e624a9ad36
2016-03-28 00:45:19 +02:00
Xinchen Hui 4cb47bd3bd Fixed compiler warnings 2016-01-25 11:45:14 +08: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
Anatol Belski 2fd282a690 use right memory api 2015-03-08 19:47:12 +01:00
Anatol Belski 2181ed2e2a started to patch for libmagic.next
everything is broken yet
2015-03-08 19:47:06 +01:00
Dmitry Stogov 4241a090ad Avoid reallocation in preg_replace() if nothing was replaced 2015-02-10 13:30:25 +03:00
Stanislav Malyshev b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00
Anatol Belski 26e5f9bab7 cleanup TSRMLS_FETCH in ext/fileinfo 2014-09-26 21:30:22 +02:00
Anatol Belski f4ebeead5d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67731 finfo::file() returns invalid mime type for binary files
2014-08-30 04:05:42 +02:00
Anatol Belski c301467f9b Fixed bug #67731 finfo::file() returns invalid mime type for binary files 2014-08-30 04:04:42 +02:00
Anatol Belski c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Xinchen Hui 9ef21b7606 Refactor fileinfo 2014-05-07 13:50:29 +08:00
Anatol Belski 62f6c5853f Fixes to various stream cast on win64
This fixes further issues on win64 with casts from the streams.
Sockets/descriptors handling was unitized. This has an impact only on
win64, php_socket_t otherwise can be feed back to int datatype.
2014-03-19 06:33:46 +01:00
Anatol Belski 967a6771d3 updated to libmagic-5.17 2014-02-19 10:02:36 +01:00
Remi Collet 89f864c547 Fixed Bug #66731 file: infinite recursion
Upstream commit (available in file-5.17)

https://github.com/glensc/file/commit/3c081560c23f20b2985c285338b52c7aae9fdb0f
https://github.com/glensc/file/commit/cc9e74dfeca5265ad725acc926ef0b8d2a18ee70
2014-02-18 13:54:33 +01:00
Anatol Belski 10367fa7c6 upgraded libmagic to 5.14 2013-04-07 22:15:56 +02:00
Xinchen Hui c06e92a533 Fixed bug #61812 (Uninitialised value used in libmagic) 2012-04-22 19:38:14 +08:00
Anatoliy Belsky e7fa402c7c Bug #61504 TSRML_FETCH() must be last 2012-03-28 12:05:20 +02:00
Pierre Joye 12cf930a40 Fix bug #61504, potential vuln. in fileinfo. update to 5.11 2012-03-27 13:34:46 +02:00
Mikko Koppanen 1496161f01 Upgrade bundled libmagic to 5.03 (fixes CDF parsing related issues)
Clean up / remove whitespace differences to make next merge easier
Removed unnecessary files from trunk
2009-12-26 15:00:21 +00:00
Scott MacVicar c3b88aec15 MFH Update libmagic to 5.02 2009-05-04 20:54:53 +00:00
Scott MacVicar 7a29c8f386 MFH Update fileinfo to libmagic 5.00 and remove dependency on dirent.h on Windows 2009-03-15 23:04:19 +00:00
Scott MacVicar a94ac5d436 MFH: Fix buffer overread in libmagic and sync a skipped change from 4.26 2008-11-06 03:00:04 +00:00
Pierre Joye 99041160df - use php's stream in libmagic
- remove duplicate code (like mime_content_type() compatibility function
  now use the same base as finfo_file())
- make it portable (works now on windows too, belongs other OSes)

- ([20:28]  <lsmith> Pierre: ok please commit)
2008-09-01 18:56:06 +00:00
Derick Rethans 6fbf14c544 - MFH: Some more cleanups, and fixed some warnings. 2008-08-29 12:05:46 +00:00
Felipe Pena 1ef7dfce3d - MFH: Fixed crash in file_error_core() 2008-08-27 00:17:27 +00:00
Ilia Alshanetsky b805c7f8b7 Upgraded the lib to use PHP memory allocation routines.
Fixed a crash caused by analysis of DEADJOE files
A little bit of CS inside libmagic
2008-08-26 12:23:29 +00:00
Antony Dovgal 273ebb45c9 MFH 2008-08-10 19:48:54 +00:00