Skip to content

Fix bug #73457 and add a test case #3466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Fix bug #73457 and add a test case #3466

wants to merge 3 commits into from

Conversation

vhuk
Copy link
Contributor

@vhuk vhuk commented Aug 24, 2018

@@ -430,6 +430,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
int8_t read_write = 0;
char *transport;
int transport_len;
zend_string *error_message;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like php_stream_xport_create() does not NULL this variable out, so it will need a NULL initialization here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if php_stream_xport_create() did the null initialization, we'd still need the =NULL here, because an error might occur prior to the php_stream_xport_create() call. An alternative would be to move the error_string handling directly into the failure branch of the php_stream_xport_create() call, rather than having it in errexit. Either way should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, NULL initialization is required. That has been fixed now.

if (error_message) {
php_stream_wrapper_log_error(wrapper, options, "Failed to set up data channel: %s", ZSTR_VAL(error_message));
zend_string_release(error_message);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Indentation

@smalyshev smalyshev added the Bug label Aug 26, 2018
@nikic
Copy link
Member

nikic commented Sep 4, 2018

Merged as 742783c into 7.1+. Thanks!

@nikic nikic closed this Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants