Closed Bug 1484990 Opened 2 years ago Closed 2 years ago

Avoid writing past the logical length of a string in XHR

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(1 file)

Don't use BeginWriting() to write past the logical length of a string in XHR. See bug 1484668 for details.
The old code assumes that it's OK to use nsAString::BeginWriting() to write
past the string's logical length if the string has enough capacity. This is
bogus, because the string doesn't know of data written past its logical
length.

The BulkWrite API has been created precisely for this purpose and allows
orderly capacity-aware low-level writes to the string.

MozReview-Commit-ID: BYQHl8Z9Fbd
Blocks: 1472113
Depends on: 1485943
No longer depends on: 1485943
Comment on attachment 9002756 [details]
Bug 1484990 - Use BulkWrite instead of write past length via BeginWriting() in XHR.

Andrea Marchesini [:baku] has approved the revision.
Attachment #9002756 - Flags: review+
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/510decfb443d
Use BulkWrite instead of write past length via BeginWriting() in XHR. r=baku
Backed out for braking many test suites e.g. Wr

Push that started the failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=510decfb443d585f9913e12227764fecaad5ea8d

*** you can see all failures from other test suites in the above link. 

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=196388469&repo=autoland&lineNumber=1089

Backout: https://hg.mozilla.org/integration/autoland/rev/618546b5d4416f83f18aa64f556bfa7584bb7be7
Flags: needinfo?(hsivonen)
Weird. Previous iterations of this patch did fine on try. I guess I should always send every iteration to try. :-(
Flags: needinfo?(hsivonen)
Another try run with a different base to see if the failures of the previous try run were due to other patches that got backed out:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=034339ff235af1d2d723115e0a43ae5a32896801
Yet another try run, hopefully with a less orange base revision:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=295c914e88701fa45466817a60bcc13f8a02cb90
Only known oranges on try!
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/47f6709be61f
Use BulkWrite instead of write past length via BeginWriting() in XHR. r=baku
https://hg.mozilla.org/mozilla-central/rev/47f6709be61f
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.