Skip to content

Conversation

@vhuk
Copy link
Contributor

@vhuk vhuk commented Aug 24, 2018

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