0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-01 05:41:58 +01:00
gitea/services/gitdiff
zeripath 45ca2e4605
Handle incomplete diff files properly (#13662)
* Handle incomplete diff files properly

The code for parsing diff hunks has a bug whereby a very long line
in a very long diff would not be completely read leading to an unexpected
character.

This PR ensures that the line is completely cleared

Fix #13602

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Also allow git max line length <4096

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add test case

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-11-21 17:41:24 -05:00
..
testdata/academic-module Fix panic when diff (#9187) 2019-11-28 17:05:57 +08:00
gitdiff_test.go Handle incomplete diff files properly (#13662) 2020-11-21 17:41:24 -05:00
gitdiff.go Handle incomplete diff files properly (#13662) 2020-11-21 17:41:24 -05:00
main_test.go