1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

459 Commits

Author SHA1 Message Date
Christoph M. Becker 7c2cc9aa56 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #66828: iconv_mime_encode Q-encoding longer than it should be
2018-09-22 15:31:02 +02:00
Christoph M. Becker 9cbe1283f7 Fix #66828: iconv_mime_encode Q-encoding longer than it should be
Before the fix for bug 48289 has been applied, the algorithm to
construct a Q-encoded-word has been optimistic, i.e. try to encode as
many bytes that *may* fit in the remaining space, calculate the actual
length of the Q-encoded word, and if it's too long, try again with a
reduced size.  However, the fix for the mentioned bug replaced this by
a pessimistic algorithm, which always terminates[1] the for loop[2]
during the first iteration (which renders the following 3 lines as dead
code), and as such easily produces unnecessarily short encoded-words.
Instead the proper fix for the bug would have been to make sure that
`out_size` is always decremented, if the space isn't sufficient for the
encoded-word.

[1] <https://github.com/php/php-src/blob/php-7.3.0beta3/ext/iconv/iconv.c#L1421>
[2] <https://github.com/php/php-src/blob/php-7.3.0beta3/ext/iconv/iconv.c#L1360>
2018-09-22 15:20:20 +02:00
Christoph M. Becker 20849b0b0f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #68180: iconv_mime_decode can return extra characters in a header
2018-08-26 13:21:22 +02:00
Christoph M. Becker efb86aef12 Fix #68180: iconv_mime_decode can return extra characters in a header
Basically, the algorithm to append a converted string to an existing
`smart_str` works by increasing the `smart_str` buffer, to let `iconv`
convert characters until there is no more space, to set the new length
of the `smart_str` and to repeat until there is no more input.

Formerly, the new length calculation has been wrong, though, since we
would have to take the old `out_len` into account (`buf_growth -
old_out_len - out_len`).  However, since there is no need to take the
old `out_len` into account when increasing the `smart_str` buffer, we
can simplify the fix, avoiding an additional variable.
2018-08-26 13:18:35 +02:00
Christoph M. Becker 314b8ecf8b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #60494: iconv_mime_decode does ignore special characters
2018-08-25 17:47:29 +02:00
Christoph M. Becker e29c946c29 Fix #60494: iconv_mime_decode does ignore special characters
We must not ignore erroneous characters in mime headers, but rather let
iconv_mime_decode() fail in this case, issuing the usual notice
regarding illegal characters.
2018-08-25 17:40:39 +02:00
Christoph M. Becker 7e176ddb57 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #63839: iconv_mime_decode_headers function is skipping headers
2018-08-25 14:52:54 +02:00
Christoph M. Becker 8754d44167 Fix #63839: iconv_mime_decode_headers function is skipping headers
We have to cater to the possibility that `=?` is not the start of an
encoded-word, but rather a literal `=?`.  If a line break is found
while we're still looking for the charset, we can safely assume that
it's a literal `=?`, and act accordingly.
2018-08-25 14:51:13 +02:00
Christoph M. Becker 6922cae4ae Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #55146: iconv_mime_decode_headers() skips some headers
2018-08-25 14:41:38 +02:00
Christoph M. Becker 6e1980e152 Fix #55146: iconv_mime_decode_headers() skips some headers
If we're expecting the start of an encoded word (`=?`), but instead of
the question mark get a line break (CR or LF), we must not append it to
the `pretval`.
2018-08-25 14:40:07 +02:00
Anatol Belski 1df43a086f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix test portability
2018-04-24 10:49:15 +02:00
Anatol Belski 919ead1157 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix test portability
2018-04-24 10:48:49 +02:00
Anatol Belski 3070883bcf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix test portability
2018-04-24 10:48:22 +02:00
Anatol Belski 4371af3e19 Fix test portability 2018-04-24 10:47:32 +02:00
Stanislav Malyshev 4c06d929c0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:03:33 -07:00
Stanislav Malyshev 95ee9efa57 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:00:24 -07:00
Stanislav Malyshev 5a18d7a0df Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 21:59:57 -07:00
Stanislav Malyshev ee76a5ae5a Fix tsrm_ls 2018-04-23 16:48:27 -07:00
Stanislav Malyshev 8dca5ae5ec Fix test 2018-04-22 22:19:51 -07:00
Stanislav Malyshev 06d309fd7a Fix bug #76249 - fail on invalid sequences 2018-04-22 21:26:39 -07:00
Nikita Popov fd255b8878 Merge branch 'PHP-7.1' into PHP-7.2 2018-01-26 22:28:48 +01:00
Philip Prindeville aad76a9b79 Be consistent in clearing out in php_iconv_string() 2018-01-26 22:28:27 +01: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
Nikita Popov edcabf6d07 Drop unnecessary allocator return value checks 2017-03-13 22:07:15 +01:00
David Carlier ea91c08232 Drop unnecessary checks of pemalloc() return value 2017-03-12 17:06:25 +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 b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Pedro Magalhães 9c5af4e4cb Remove the b prefix from literals on unrelated tests 2016-11-20 21:11:53 +01:00
Kalle Sommer Nielsen 2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Stanislav Malyshev 1fd18821e0 More string length checks & fixes 2016-11-03 21:35:09 -07:00
Anatol Belski 42b7912f03 catch up with stream datatypes 2016-10-05 22:53:21 +02:00
Anatol Belski a989091880 remove useless assignment 2016-09-01 23:45:31 +02:00
Christoph M. Becker ec8bbba9c6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 01:18:59 +02:00
Christoph M. Becker a837b2f6a3 Fix #72320: iconv_substr returns false for empty strings
For consistency with substr() and mb_substr(), iconv_substr() should return
an empty string instead of FALSE, when $offset == iconv_strlen($str).
2016-07-29 11:33:50 +02:00
Francois Laupretre 570bbed98e Add negative offset support to iconv_strpos() 2016-03-09 14:41:38 +01:00
Francois Laupretre 56fce8990f strpos()/stripos(): Add support for negative offsets 2016-03-09 14:41:37 +01:00
Nikita Popov 1ac152938c Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE
Also re bug #71575.
2016-03-03 16:50:01 +01:00
Nikita Popov c9357f82d3 Format string fixes
Conflicts:
	ext/pgsql/pgsql.c
2016-02-14 14:45:53 +01: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 2b9c7f881a fix tests 2015-08-21 15:13:39 +02:00
Julien Pauli aae9004ebd Removed dead code 2015-08-17 17:18:25 +02:00
Xinchen Hui fb3d14460b Fixed condition 2015-07-30 15:09:56 +08:00
Anatol Belski 4e66cce87c switch to the unified globals accessor where appropriate 2015-07-29 13:26:35 +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
Christoph M. Becker c9554b90e4 added regression test for bug #69840 2015-06-17 13:40:19 +02:00
Kalle Sommer Nielsen ff9e290438 Fixed bug #69840 (iconv_substr() doesn't work with UTF-16BE) 2015-06-17 09:39:45 +02:00