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

mime client reader, avoid infinite loop #14532

Closed
wants to merge 2 commits into from

Conversation

icing
Copy link
Contributor

@icing icing commented Aug 13, 2024

Curl_mime_read() may go into an infinite loop when called with buffer lengths <= 4. Some encoders, like base64, are not prepared for that.

In the client reader for mime data, skip such small reads. The upload buffers will get flushed eventually and larger reads will happen again.

Improves robustness of test652 which triggered the loop on blocked sends.

Refs #14527.

@github-actions github-actions bot added the MIME label Aug 13, 2024
@vszakats vszakats changed the title mime client reader, avoid inifite loop mime client reader, avoid inifinite loop Aug 13, 2024
@vszakats vszakats changed the title mime client reader, avoid inifinite loop mime client reader, avoid infinite loop Aug 13, 2024
@bagder
Copy link
Member

bagder commented Aug 14, 2024

scanbuild seems to have an opinion here!

@icing
Copy link
Contributor Author

icing commented Aug 14, 2024

scanbuild seems to have an opinion here!

I hate compilers that warn about "unnecessary inits". 🤮

Curl_mime_read() may go into an infinite loop when called with
buffer lengths <= 4. Some encoders, like base64, are not prepared
for that.

In the client reader for mime data, skip such small reads. The
upload buffers will get flushed eventually and larger reads will
happen again.

Improves robustness of test652 which triggered the loop on blocked
sends.
@icing
Copy link
Contributor Author

icing commented Aug 14, 2024

Rebased and removed the init line.

@bagder bagder closed this in c90a3f1 Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants