fix(tus): reject negative upload-length to prevent inconsistent cache entry (#5876)

This commit is contained in:
Ariel Leyva 2026-04-04 03:11:50 -04:00 committed by GitHub
parent 0f39bd055e
commit 7a16129bfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -105,7 +105,7 @@ func tusPostHandler(cache UploadCache) handleFunc {
}
uploadLength, err := getUploadLength(r)
if err != nil {
if err != nil || uploadLength < 0 {
return http.StatusBadRequest, fmt.Errorf("invalid upload length: %w", err)
}