-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Prevent panic on git blame by limiting lines to 4096 bytes at most #13470
Prevent panic on git blame by limiting lines to 4096 bytes at most #13470
Conversation
Fix go-gitea#12440 Closes go-gitea#13192 Signed-off-by: Andrew Thornton <art27@cantab.net>
There is a potentially nicer solution here - limit the lines to 1024 or possibly a fewer number of runes and create an expansion button. However this PR presents the simplest fix to prevent the panic. |
works nicely |
🚀 |
Codecov Report
@@ Coverage Diff @@
## master #13470 +/- ##
==========================================
+ Coverage 42.05% 42.19% +0.13%
==========================================
Files 694 694
Lines 76334 76347 +13
==========================================
+ Hits 32105 32212 +107
+ Misses 38971 38857 -114
- Partials 5258 5278 +20
Continue to review full report at Codecov.
|
🚀 |
…o-gitea#13470) Fix go-gitea#12440 Closes go-gitea#13192 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
…o-gitea#13470) Fix go-gitea#12440 Closes go-gitea#13192 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This PR prevents the panic by limiting the number of bytes per line to 4096 bytes (The default buffer size for a reader)
Fix #12440
Closes #13192
Signed-off-by: Andrew Thornton art27@cantab.net