diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2024-02-22 04:48:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-22 03:48:19 +0000 |
commit | d6811baf88ca6d58b92d4dc12b1f2a292198751f (patch) | |
tree | 95e35c3e2da9b468b10f2ca265d75c609f4929c7 /modules/git/pipeline/lfs_nogogit.go | |
parent | c236e64aca42b9ab0743431bc505033a0cb78b93 (diff) | |
download | gitea-d6811baf88ca6d58b92d4dc12b1f2a292198751f.tar.gz gitea-d6811baf88ca6d58b92d4dc12b1f2a292198751f.zip |
Discard unread data of `git cat-file` (#29297)
Fixes #29101
Related #29298
Discard all read data to prevent misinterpreting existing data. Some
discard calls were missing in error cases.
---------
Co-authored-by: yp05327 <576951401@qq.com>
Diffstat (limited to 'modules/git/pipeline/lfs_nogogit.go')
-rw-r--r-- | modules/git/pipeline/lfs_nogogit.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/git/pipeline/lfs_nogogit.go b/modules/git/pipeline/lfs_nogogit.go index a725f4799d..4c65249089 100644 --- a/modules/git/pipeline/lfs_nogogit.go +++ b/modules/git/pipeline/lfs_nogogit.go @@ -169,6 +169,10 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err } else { break commitReadingLoop } + default: + if err := git.DiscardFull(batchReader, size+1); err != nil { + return nil, err + } } } } |