Closed Bug 114438 Opened 23 years ago Closed 23 years ago

Ensure nsSharableString doesn't overwrite shared buffers

Categories

(Core :: XPCOM, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9.7

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file)

There are two ways that nsSharableString might overwrite shared buffers:

 1) SetLength() can cause overwriting since it doesn't check the buffer's refcount

 2) using writing iterators can cause ovewriting.  It's not clear how we should
solve this problem in the long term (see bug 114140), but a short-term solution
that works is to override GetWritableFragment.  The long-term solution may
involve changing all the users.

I'll attach the patch that fixes these two issues, which I'd like to get in for
0.9.7.  I previously attached a superset of this patch to bug 112548 (and asked
jag to review the subset that I'm attaching here).
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla0.9.7
Comment on attachment 61104 [details] [diff] [review]
patch

sr=jst
Attachment #61104 - Flags: superreview+
dbaron landed the fix on 12/10/2001 19:33
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: