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

make multipart robust against ill-formed body, prevents SIGSEGV #385

Merged
merged 3 commits into from
Apr 4, 2022

Conversation

hsiegmund
Copy link

No description provided.

@crow-clang-format
Copy link

--- include/crow/multipart.h	(before formatting)
+++ include/crow/multipart.h	(after formatting)
@@ -173,7 +173,8 @@
                 while (body != (crlf))
                 {
                     size_t found = body.find(delimiter);
-                    if (found == std::string::npos) {
+                    if (found == std::string::npos)
+                    {
                         // did not find delimiter; probably an ill-formed body; ignore the rest
                         break;
                     }

Copy link
Member

@The-EDev The-EDev left a comment

Choose a reason for hiding this comment

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

There's probably more to be done here, maybe signaling that this is an ill formed body. But this is a good start for the time being. Thank you for your help!

@The-EDev The-EDev merged commit 391bd2d into CrowCpp:master Apr 4, 2022
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.

2 participants