summaryrefslogtreecommitdiffstats
path: root/modules/git/pipeline/lfs_nogogit.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2024-02-22 04:48:19 +0100
committerGitHub <noreply@github.com>2024-02-22 03:48:19 +0000
commitd6811baf88ca6d58b92d4dc12b1f2a292198751f (patch)
tree95e35c3e2da9b468b10f2ca265d75c609f4929c7 /modules/git/pipeline/lfs_nogogit.go
parentc236e64aca42b9ab0743431bc505033a0cb78b93 (diff)
downloadgitea-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.go4
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
+ }
}
}
}