Open Bug 354306 Opened 18 years ago Updated 2 years ago

Line-break munging in nsGlobalWindow::Dump is wrong

Categories

(Core :: DOM: Core & HTML, defect, P5)

PowerPC
macOS
defect

Tracking

()

People

(Reporter: jruderman, Unassigned)

Details

Two problems in nsGlobalWindow::Dump:

1) "cstr" is used, then null-checked.  The null check is either needed or not.

2) "cEnd = cstr + aStr.Length" might be ok if the string only contains ASCII text, but it is often wrong for other languages.


3209 nsGlobalWindow::Dump(const nsAString& aStr)
...
3227   char *cstr = ToNewUTF8String(aStr);
3228 
3229 #if defined(XP_MAC) || defined(XP_MACOSX)
3230   // have to convert \r to \n so that printing to the console works
3231   char *c = cstr, *cEnd = cstr + aStr.Length();
3232   while (c < cEnd) {
3233     if (*c == '\r')
3234       *c = '\n';
3235     c++;
3236   }
3237 #endif
3238 
3239   if (cstr) {
3240     printf("%s", cstr);
3241     nsMemory::Free(cstr);
3242   }
Assignee: general → nobody
QA Contact: ian → general
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.