-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
2.x.x: guard for index overflow #404
2.x.x: guard for index overflow #404
Conversation
I'm wondering if you could implement this as two loops to reduce the number of checks eg while index < original.endIndex - 2 {
...
}
while index < original.endIndex {
... ignore percent encoding
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good. Can we add a test to verify it.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #404 +/- ##
==========================================
- Coverage 84.86% 83.77% -1.10%
==========================================
Files 98 99 +1
Lines 5320 4087 -1233
==========================================
- Hits 4515 3424 -1091
+ Misses 805 663 -142 ☔ View full report in Codecov by Sentry. |
Thank you for finding, reporting and especially for fixing this! |
oh snap I accidentally deleted a test case from the file while I was working on this :P will force push the replacement here shortly....apologies |
49f07cd
to
feb774c
Compare
feb774c
to
ecbd7a8
Compare
hello,
I have been using the hummingbird 2.x.x alphas (and now beta) in production (like a madman) and have been super impressed with how well it has been running. thank you for all your work on this project - its fantastic.
as I expose this socket to more of the wild, I am beginning to pick up on traffic that is causing
2.x.x beta1
and priors to crash.here is a stack trace of what that looks like (from Ubuntu Linux):
Problem: Looks like I am getting some traffic with bad query params that are causing the HBParser code to overflow.
Solution: I simply guard against this potential overflow before it happens.
Result: My production service no longer reproduces the above stacktrace when I deploy using the commit proposed here.