Open
Bug 354306
Opened 19 years ago
Updated 3 years ago
Line-break munging in nsGlobalWindow::Dump is wrong
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
NEW
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 }
Updated•16 years ago
|
Assignee: general → nobody
QA Contact: ian → general
Comment 1•7 years ago
|
||
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
| Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•