Fix #80067: Omitting the port in bindto setting errors#6104
Closed
cmb69 wants to merge 1 commit intophp:PHP-7.3from
Closed
Fix #80067: Omitting the port in bindto setting errors#6104cmb69 wants to merge 1 commit intophp:PHP-7.3from
cmb69 wants to merge 1 commit intophp:PHP-7.3from
Conversation
A recent commit[1] which fixed a memory leak introduced a regression regarding the formerly liberal handling of IP addresses to bind to. We fix this by reverting that commit, and fix the memory leak where it actually occurs. In other words, this fix is less intrusive than the former fix. [1] <http://git.php.net/?p=php-src.git;a=commit;h=0b8c83f5936581942715d14883cdebddc18bad30>
nikic
reviewed
Sep 9, 2020
| /* free error string received during previous iteration (if any) */ | ||
| if (*error_string) { | ||
| zend_string_release_ex(*error_string, 0); | ||
| } |
Member
There was a problem hiding this comment.
Is it feasible to push this up into the caller? It seems somewhat odd to deal with it here.
Member
Author
There was a problem hiding this comment.
These changes are all in php_network_getaddresses() which is exported. We could fix all calls from core and bundled extensions, but external extensions may have the same memory leak.
Also note that I copied that snippet from php_network_connect_socket_to_host(), and that had been introduced with 79d649e (which fixed a similar memory leak long ago).
Maybe leave it this way for PHP 7, and push up into the caller for PHP 8?
Member
Author
|
/cc @twose |
nikic
approved these changes
Sep 11, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A recent commit[1] which fixed a memory leak introduced a regression
regarding the formerly liberal handling of IP addresses to bind to. We
fix this by reverting that commit, and fix the memory leak where it
actually occurs. In other words, this fix is less intrusive than the
former fix.
[1] http://git.php.net/?p=php-src.git;a=commit;h=0b8c83f5936581942715d14883cdebddc18bad30