mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Backport #29297 by @KN4CK3R Fixes #29101 Related #29298 Discard all read data to prevent misinterpreting existing data. Some discard calls were missing in error cases. Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
@@ -58,6 +58,9 @@ func (repo *Repository) getTree(id SHA1) (*Tree, error) {
|
||||
tree.entriesParsed = true
|
||||
return tree, nil
|
||||
default:
|
||||
if err := DiscardFull(rd, size+1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, ErrNotExist{
|
||||
ID: id.String(),
|
||||
}
|
||||
|
Reference in New Issue
Block a user