Skip to content

Bug Fix for bug#61537 json_encode() incorrectly truncates/discards infor... - #111

Closed
srgoogleguy wants to merge 1 commit into
php:masterfrom
srgoogleguy:BugFix61537
Closed

Bug Fix for bug#61537 json_encode() incorrectly truncates/discards infor...#111
srgoogleguy wants to merge 1 commit into
php:masterfrom
srgoogleguy:BugFix61537

Conversation

@srgoogleguy

Copy link
Copy Markdown
Contributor

...mation

json_encode() will now always return bool(false) if an error is present

I'm resubmitting this since the previous patch was reverted. This was originally intended as a temporary workaround but someone has suggested it be submitted in light of the revert to close the bug report. Let me know if any changes need to go through (I'm submitting this PR for master).

…formation

json_encode() will now always return bool(false) if an error is present
@nikic

nikic commented Jun 20, 2012

Copy link
Copy Markdown
Member

The previous patch added a new option to get back to the old behavior. Do we need this or not?

@tml

tml commented Jun 20, 2012

Copy link
Copy Markdown
Contributor

I would consider the BC option to be optional; there may be someone out there who is relying on the current behaviour, but that behaviour has never (AFAICT) matched what json_encode() is documented to do.

@nikic

nikic commented Jun 23, 2012

Copy link
Copy Markdown
Member

Two preliminary commits:

84fe2cc
36fa17a

The warning for UTF-8 will be adjusted depending on what comes out of the discussion.

@tml

tml commented Jun 23, 2012

Copy link
Copy Markdown
Contributor

In the meantime, how do we get the ChangeLog corrected? It currently incorrectly asserts that this bug is fixed in 5.4.4

@srgoogleguy

Copy link
Copy Markdown
Contributor Author

Closing

I see no point for this to remain opened at this time.

php-pulls pushed a commit that referenced this pull request Sep 15, 2014
php-pulls pushed a commit that referenced this pull request Sep 15, 2014
* PHP-5.6:
  Fix NEWS - #65641 mod_proxy-fcgi is not fixed (still open) - #67606 mod_fastcgi is fixed in ee275e3
  Fix NEWS - #65641 mod_proxy-fcgi is not fixed (still open) - #67606 mod_fastcgi is fixed in ee275e3
  Fix bug #111 (compile error without ZEND_SIGNALS)
  Don't run travis against master (phpng)
  Update README.md
php-pulls pushed a commit that referenced this pull request Sep 15, 2014
EdmondDantes added a commit to true-async/php-src that referenced this pull request May 10, 2026
…ip over (refs php#111)

Companion to the libuv reactor fix in ext/async. Establishes the
ownership invariant on zend_async_dns_addrinfo_t.result: while the
field is non-NULL the event owns the addrinfo, once cleared the
consumer owns it. Without this clear, dispose's free path would
double-free the addrinfo on the normal (success) flow.
EdmondDantes added a commit to true-async/php-src that referenced this pull request May 10, 2026
The previous fix transferred addrinfo ownership to the consumer correctly
on the success path but missed a race: if cancellation arrives between
dns_callback_resolve writing *res and the awaiting coroutine actually
returning from SUSPEND, the function falls into the error branch and
returns -1. The caller checks the return code and never invokes
freeaddrinfo on *res, so the addrinfo (already handed over by the event)
leaks.

CI run 25629357944 confirmed the leak still hit in three TCP-accept
cancel-during-io scenarios (zero-delay cancel) under ASAN+ZTS.

Free *res ourselves in the error path and reset it to NULL so callers
never see a stale pointer.
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
* PHP-5.6:
  Fix NEWS - #65641 mod_proxy-fcgi is not fixed (still open) - #67606 mod_fastcgi is fixed in 0bd56ce
  Fix NEWS - #65641 mod_proxy-fcgi is not fixed (still open) - #67606 mod_fastcgi is fixed in 0bd56ce
  Fix bug php#111 (compile error without ZEND_SIGNALS)
  Don't run travis against master (phpng)
  Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants