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

INKVConnInternal::do_io_*: handle null buffer (#11789) #11802

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

bneradt
Copy link
Contributor

@bneradt bneradt commented Oct 1, 2024

It's common for users of VC's to cancel io via a 0 byte, nullptr read or write on the VC. INKVConnInternal::do_io_read and
INKVConnInternal::do_io_write were not prepared to handle such cancellations. This updates them to handle this gracefully rather than crashing on a nullptr dereference. This change is was found to be needed for the multiplexer plugin for handling HttpTunnel aborts.

For reference, see, for example, UnixNetVConnection::do_io_read which handles a nullptr MIOBuffer. This basically copies that logic into INKVConnInternal so it handles cancellation gracefully.

It's common for users of VC's to cancel io via a 0 byte, nullptr read or
write on the VC. INKVConnInternal::do_io_read and
INKVConnInternal::do_io_write were not prepared to handle such
cancellations. This updates them to handle this gracefully rather than
crashing on a nullptr dereference. This change is was found to be needed
for the multiplexer plugin for handling HttpTunnel aborts.

For reference, see, for example, UnixNetVConnection::do_io_read which
handles a nullptr MIOBuffer. This basically copies that logic into
INKVConnInternal so it handles cancellation gracefully.
@bneradt bneradt requested a review from cmcfarlen October 1, 2024 19:40
@bneradt bneradt self-assigned this Oct 1, 2024
@cmcfarlen cmcfarlen added this to the 10.0.1 milestone Oct 1, 2024
@cmcfarlen
Copy link
Contributor

[approve ci centos]

@cmcfarlen cmcfarlen merged commit ab2d651 into apache:10.0.x Oct 1, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants