nsHttpChannel wraps the aOffset value it passes to its stream listener instead of clamping it

RESOLVED FIXED in mozilla14

Status

()

Core
Networking: HTTP
--
trivial
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: briansmith, Assigned: briansmith)

Tracking

Trunk
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment)

Created attachment 607035 [details] [diff] [review]
Clamp offset passed to OnDataAvailable instead of wrapping it

See the documentation:

     * @param aOffset
     *        Number of bytes that were sent in previous onDataAvailable calls
     *        for this request. In other words, the sum of all previous count
     *        parameters.
     *        If that number is greater than or equal to 2^32, this parameter
     *        will be PR_UINT32_MAX (2^32 - 1).

The attached patch clamps the value in the same way that nsInputStreamPump::OnStateTransfer does.

Without this patch, MSVC complains about the implicit PRUint64 to PRUint32 conversion when mLogicalOffset is passed to OnDataAvailable.
Attachment #607035 - Flags: review?(cbiesinger)
Attachment #607035 - Flags: review?(cbiesinger) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/d242e16d161c
Severity: normal → trivial
OS: Windows 7 → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla14
http://hg.mozilla.org/mozilla-central/rev/d242e16d161c
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.