Closed Bug 13598 Opened 26 years ago Closed 26 years ago

nsAutoString ucs2(CBufDescriptor("ucs2", PR_TRUE, strlen("ucs2"))) crashes

Categories

(Core :: DOM: HTML Parser, defect, P1)

All
Mac System 8.5
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sfraser_bugs, Assigned: mikepinkerton)

Details

Recently, some changes were made like this in HTML parser: < nsString ucs2("ucs2"); --- > nsAutoString ucs2(CBufDescriptor("ucs2", PR_TRUE, strlen("ucs2"))); These cause problems; somewhere, we write off the of the buffer, and bad shit happens. This may have something to do with this line in CBufDescriptor::CBufDescriptor(char* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) { mCapacity=aCapacity-1;
Summary: nsAutoString ucs2(CBufDescriptor("ucs2", PR_TRUE, strlen("ucs2"))); does not work → nsAutoString ucs2(CBufDescriptor("ucs2", PR_TRUE, strlen("ucs2"))) crashes
Adjust summary to be more accurate.
Severity: normal → blocker
Priority: P3 → P1
linux, viewer, test8, type in a text field, crash. blocker.
maybe this is another good argument for why we need a simpler mechanism for strings that don't copy. ;) ;) ;)
The call is being used wrong. Here's the correct call in this case: nsAutoString ucs2(CBufDescriptor("ucs2", PR_TRUE, strlen("ucs2")+1));
that's what i thought, but no one would try that fix for me ;) Thanks rick.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
closing out bug. it seems to have been fixed by hook or by crook.
Whiteboard: [19990914] sfraser, is this fixed?
Status: RESOLVED → VERIFIED
Whiteboard: [19990914] sfraser, is this fixed?
fixed per reporter
You need to log in before you can comment on or make changes to this bug.