-
-
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
Removed some vestigial code related to Range bounds checks #20312
Conversation
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.
Is there a test case where this issue can be reproduced(and ideally can be included into Gitea integration tests.
I don't understand the problem. The initial |
Update: hmm ... the toByte was already checked above. 😂 Maybe the problem is that the size in meta doesn't match the real file size? |
The meta size is checked against the written size, must be correct. gitea/modules/lfs/content_store.go Lines 142 to 144 in cb6c5f8
|
Yes, I will have to check to see if this is a problem in latest Gitea. The hashingReader code looks like it might address it, I was working based off an older version. |
I was able to verify that this issue has been fixed in latest Gitea. Although, there is still some dead code, so I changed this PR to be just about removing the dead code. Thanks for the help, all. |
Codecov Report
@@ Coverage Diff @@
## main #20312 +/- ##
=======================================
Coverage ? 46.94%
=======================================
Files ? 977
Lines ? 135303
Branches ? 0
=======================================
Hits ? 63519
Misses ? 64001
Partials ? 7783
Help us with your feedback. Take ten seconds to tell us how you rate us. |
* giteaofficial/main: Removed some vestigial code related to Range bounds checks (go-gitea#20312) Add markdownlint (go-gitea#20512) Fix possible panic when repository is empty (go-gitea#20509) patch (doc): add heading to ssh flow explanation (go-gitea#20506) Show hint to link package to repo when viewing empty repo package list (go-gitea#20504) Fix ROOT_URL detection for URLs without trailing slash (go-gitea#20502) Add Tar ZSTD support (go-gitea#20493)
When an LFS pointer file has a size that is too large (compared to the actual blob size), the Git LFS client can make Range requests that are out of bounds. Currently Gitea tries to obey these requests but gets an EOF during the copy and still responds with a 200, so this PR adds a bounds check to error early if that would be about to happen.
Also removed some vestigial code related to the bounds checks.
Update: see comment below