Closed Bug 1506681 Opened 6 years ago Closed 3 years ago

Bounds-check autoAllocateChunkSize before using it

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: jorendorff, Assigned: mgaudet)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Byte streams are disabled for now, so the autoAllocateChunkSize field is always `undefined`. So this bug report refers to code that is currently dead. Scripts can provide an autoAllocateChunkSize value to the ReadableStream constructor, and the spec says the stream is supposed to allocate ArrayBuffers of that size. Our existing code for this does only the sanity-checking explicitly required by the spec: make sure the chunk size is a positive integer value. We should also check that the value is within the range that the ArrayBuffer constructor accepts (currently up to 2GB). Otherwise I think streams could be used to circumvent that limit.
Blocks: 1755374
Assignee: nobody → mgaudet
Status: NEW → ASSIGNED

(Note: I think the responsibility for checking this lies in the ArrayBuffer constructor, so no streams specific changes are needed)

Pushed by mgaudet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2f26fa82e27c Add test for array buffer size limitations in BYOB Readable byte streams r=saschanaz
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: