Commit Graph

49580 Commits

Author SHA1 Message Date
Moriyoshi Koizumi
e427182279 Fix bug #62373 (serialize() generates wrong reference to the object) 2012-06-25 19:13:23 +09:00
Nikita Popov
5b3f4d25ea Fix memory allocation checks for base64 encode
base64_encode used safe_emalloc, but one of the arguments was derived from a
multiplication, thus making the allocation unsafe again.

There was a size check in place, but it was off by a factor of two as it
didn't account for the signedness of the integer type.

The unsafe allocation is not exploitable, but still causes funny behavior
when the sized overflows into a negative number.

To fix the issue the *4 factor is moved into the size argument (where it is
known to be safe), so safe_emalloc can carry out the multiplication.

The size check is removed as it doesn't really make sense once safe_emalloc
works correctly. (Would only cause base64_encode to silently return false
instead of throwing an error. Also could cause problems with other uses of
the base64 encoding API, which all don't check for a NULL return value.)

Furthermore the (length + 2) < 0 check is replaced with just length < 0.
Allowing lengths -2 and -1 doesn't make sense semantically and also is not
honored in the following code (negative length would access unallocated
memory.)

Actually the length < 0 check doesn't make sense altogether, but I left it
there just to be safe.
2012-06-24 23:32:50 +02:00
Nikita Popov
84fe2cc890 Improve json_encode error handling
json_encode() now returns bool(false) for all possible errors, throws the
respective warning and also sets the respective json_last_error() error
code. Three new error codes have been added:

  * JSON_ERROR_RECURSION
  * JSON_ERROR_INF_OR_NAN
  * JSON_ERROR_UNSUPPORTED_TYPE

To get a partial JSON output instead of bool(false) the option
JSON_PARTIAL_OUTPUT_ON_ERROR can be specified. In this case the invalid
segments will be replaced either by null (for recursion, unsupported type
and invalid JSON) or 0 (for Inf and NaN).

The warning for invalid UTF-8 stays intact and is thrown also with
display_errors = On. If this behavior is undesired this can be remedied
later.
2012-06-23 20:51:52 +02:00
Felipe Pena
cc90ac54be - BFN 2012-06-23 15:21:20 -03:00
Felipe Pena
c3f34796a0 - Improved fix for #62384 2012-06-23 15:10:47 -03:00
Johannes Schlüter
84b1c568f4 Remove unneeded and outdated ChangeLog file 2012-06-22 20:00:20 +02:00
Johannes Schlüter
a62d4e2c43 Remove extra ; 2012-06-22 17:32:46 +02:00
Felipe Pena
b8e946b02e - Fixed bug #62384 (Attempting to invoke a Closure more than once causes segfaul) 2012-06-22 12:05:29 -03:00
Johannes Schlüter
055ecbc628 Improve check for :memory: pseudo-filename in SQlite 2012-06-22 12:48:39 +02:00
Johannes Schlüter
d93892de7a Remove outdated and user-specific files 2012-06-20 19:46:32 +02:00
Nikita Popov
5d81fe6f12 Add NEWS for bug #62262 2012-06-19 18:40:46 +02:00
Nikita Popov
fed1f2d124 Fixed bug RecursiveArrayIterator does not implement Countable
ArrayIterator implemented Countable only after it was already inherited by
RecursiveArrayIterator. Thus the interface was missing in RAI.
2012-06-19 18:32:44 +02:00
Anatoliy Belsky
e793539678 sync zip ext version with pecl 2012-06-19 17:15:56 +02:00
Anatoliy Belsky
f072662621 one more correction for COM upgrading notes 2012-06-19 14:42:59 +02:00
Anatoliy Belsky
a8948d0808 split gzgetc_basic.phpt for zlib 1.2.7 2012-06-19 14:08:34 +02:00
Anatoliy Belsky
592917f91f com ext upgrading correction 2012-06-18 22:07:19 +02:00
Anatoliy Belsky
6176b96a23 com ext upgrading info 2012-06-18 21:56:17 +02:00
Anatoliy Belsky
d3780f1f90 Reverted the BC fix regarding to #57905, test adopted
New 0.10.1 has a stronger archive integrity check. Restoring
the old behaviour of libzip < 0.10.1 makes no sense at this
place.
2012-06-17 16:04:36 +02:00
Johannes Schlüter
26cb570615 Merge PHP 5.3.14 NEWS 2012-06-13 10:35:58 +02:00
Stanislav Malyshev
f0d6059389 re-add 61755 to NEWS 2012-06-12 11:52:22 -07:00
David Soria Parra
f464ffd780 Make travis silent
Travis will always build all branches. As we just have a .travis.yml
on master, travis will go ahead and checkout PHP-5.3. It fails and
then sends mails. We really don't want to get spammed, so we add
a .travis.yml that is just silent.
2012-06-10 18:17:37 +04:00
michelangelo
cda14b995c Adding a test for ext/posix/tests/posix_getegid_basic.phpt 2012-06-10 17:07:49 +04:00
Stanislav Malyshev
17c0ff1194 typo 2012-06-08 01:24:49 -07:00
Stanislav Malyshev
fc74503792 improve overflow checks 2012-06-08 01:21:37 -07:00
Stanislav Malyshev
7d04e0fb2e fix potential overflow in _php_stream_scandir 2012-06-07 23:08:35 -07:00
Anatoliy Belsky
baacc2cb13 set current versions for libzip and zip ext 2012-06-07 22:32:03 +02:00
Anatoliy Belsky
9ecb67d5a4 updated NEWS 2012-06-07 21:43:07 +02:00
Anatoliy Belsky
bde0e8c2a1 zip windows fixes 2012-06-07 21:01:32 +02:00
Anatoliy Belsky
8ca457f64d fixed bc break related to #57905 2012-06-07 21:01:32 +02:00
Anatoliy Belsky
e883892664 fixed a bit overlooked from the last libzip port 2012-06-07 21:01:32 +02:00
Anatoliy Belsky
b8cdc731b8 brought the fix for #47667 back 2012-06-07 21:01:32 +02:00
Anatoliy Belsky
a37e84e549 fixed zip entry freeing 2012-06-07 21:01:32 +02:00
Anatoliy Belsky
f4a44f18b8 rechecked the merged libzip, took also the indents from the original to
avoid confusion next time
2012-06-07 21:01:31 +02:00
Anatoliy Belsky
a39bcfc5ee fixed a double freeing crash 2012-06-07 21:01:31 +02:00
Anatoliy Belsky
9a2365412e fixed header include 2012-06-07 21:01:31 +02:00
Anatoliy Belsky
335a11b14b initial libzip upgrade patch to 0.10.1 2012-06-07 21:01:31 +02:00
Felipe Pena
7cae4ff02c - BFN 2012-06-07 14:23:17 -03:00
Felipe Pena
018a9b321f Merge commit '15213768e6cc098ab4e53cacc3b5eb86fa85284a' into PHP-5.3 2012-06-07 14:18:34 -03:00
Pierrick Charron
4e6f27f4db Regenerated files 2012-06-07 18:02:27 +02:00
Pierrick Charron
fed5923dbc Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)
Modify the scanner to check if the first char of the raw data is an opening " in which case we
need to find the closing one. Otherwise just search for the next end of value char [\r\n;\000]
2012-06-07 17:44:20 +02:00
Till Klampaeckel
c56ff39c05 Don't depend on a fixed path for PHP shebang but use /usr/bin/env
(cherry picked from commit 89c5d981603ed4a2a54f86c20cec4f263c58ded6)
2012-06-07 09:44:49 +02:00
Xinchen Hui
6ecc9f1d9d Remove unused codes 2012-06-07 14:31:35 +08:00
slayercat
d9810af45a based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.
via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx

"Do not cast a pointer to a FILETIME structure to either a
ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows."
2012-06-07 14:28:05 +08:00
Gustavo André dos Santos Lopes
c1ac325228 Fix ext/intl build on ICU < 4.8 2012-06-06 12:10:00 +02:00
Gustavo André dos Santos Lopes
52d541a314 Optimization in ext/intl/msgformat
Don't transform the string to make it apostrophe friendly in ICU 4.8+
as that it is now the default.
2012-06-06 11:36:00 +02:00
Gustavo André dos Santos Lopes
45b3fa4dee Fixed tests in ext/intl
21 is not a valid value for UNUM_PADDING_POSITION. Changed the test to
use 2 instead.

Remove ICU 4.2- test. No one cares.
2012-06-05 16:47:00 +02:00
Felipe Pena
15213768e6 - Fixed bug #62227 (Invalid phar stream path causes crash) 2012-06-04 20:07:14 -03:00
Gustavo André dos Santos Lopes
9b233b7e5e Changed XFAILed collator_get_sort_key.phpt
Ressurected and limited to ICU 4.8 in the hope that the sort keys
will remain stable in more recent ICU versions. I have only tested
with ICU 4.8 so far.
2012-06-04 10:18:24 +02:00
Felipe Pena
4fc49c04df Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.3 2012-06-03 19:00:49 -03:00
Felipe Pena
d57b278ad1 - Optimize comparison between same HashTable pointer 2012-06-03 18:16:57 -03:00