Skip to content
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

Fix error checking in mysqlnd #11925

Conversation

kamil-tekiela
Copy link
Member

The variable bytes_sent is ssize_t while the calling applications expect size_t. If the socket returns -1 then we overflow our unsigned return type and the calling code doesn't know the command failed.

I don't know how to write a test case for this. This was discovered thanks to this bug #11897. It definitely fixes a bug when a socket connection drops connection.

Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

ju1ius pushed a commit to ju1ius/php-src that referenced this pull request Aug 15, 2023
jorgsowa pushed a commit to jorgsowa/php-src that referenced this pull request Aug 16, 2023
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.

None yet

2 participants