I tracked it down further today, accidentally finding a reproducer. In
methods/http.cc we check for Req.DownloadSize > Req.MaximumSize and fail
with an error if that's the case; hence ensuring our download was within
the allowed range for the request.

The issue is that Req.MaximumSize is calculated by
BaseHttpMethod::FindMaximumObjectSizeInQueue as  the maximum of all
maximum sizes in the queue; and requests with unknown sizes are encoded
as 0, so FindMaximumObjectSizeInQueue() will return any other size that
is not 0, despite the 0 meaning "unknown". The fix is to return 0 if any
maximum size is 0.

** Also affects: apt (Ubuntu Groovy)
   Importance: Undecided
       Status: New

** Also affects: apt (Ubuntu Hirsute)
   Importance: Undecided
       Status: Triaged

** Also affects: apt (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Also affects: apt (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Summary changed:

- apt install - File has unexpected size - http pipeline
+ size mismatch error if request of unknown size is larger than others

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1921626

Title:
  size mismatch error if request of unknown size is larger than others

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1921626/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to