Closed
Bug 330030
Opened 19 years ago
Closed 19 years ago
crash (@ nsConverterOutputStream::Flush) if init() did not succeed
Categories
(Core :: Internationalization, defect)
Core
Internationalization
Tracking
()
RESOLVED
FIXED
People
(Reporter: asqueella, Assigned: asqueella)
Details
(Keywords: crash, fixed1.8.1)
Attachments
(1 file)
1.77 KB,
patch
|
Biesinger
:
review+
darin.moz
:
superreview+
darin.moz
:
approval-branch-1.8.1+
|
Details | Diff | Splinter Review |
Running the following crashes firefox trunk:
var file = Components.classes['@mozilla.org/file/directory_service;1']
.getService(Components.interfaces.nsIProperties)
.get('ProfD', Components.interfaces.nsIFile);
file.append("test");
var os = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
os.init(file, 0x04 | 0x08 | 0x20, 420, 0);
var cos = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
.createInstance(Components.interfaces.nsIConverterOutputStream);
try {
cos.init(os, "klkl", 0, 0x0000);//throws
} catch(e) {
}
cos.close();//crashes
uconv.dll!nsConverterOutputStream::Flush() Line 145 + 0x29 bytes C++
uconv.dll!nsConverterOutputStream::Close() Line 169 + 0xe bytes C++
xpcom_core.dll!XPTC_InvokeByIndex(...) Line 102 C++
Assignee | ||
Comment 1•19 years ago
|
||
The destructor part isn't necessary to fix the crash, but Close() is enough there, since it both checks mOutStream and calls Flush().
Assignee: smontagu → asqueella
Status: NEW → ASSIGNED
Attachment #214666 -
Flags: superreview?(darin)
Attachment #214666 -
Flags: review?(cbiesinger)
Comment 2•19 years ago
|
||
Comment on attachment 214666 [details] [diff] [review]
patch
oops.
Attachment #214666 -
Flags: review?(cbiesinger) → review+
Comment 3•19 years ago
|
||
Comment on attachment 214666 [details] [diff] [review]
patch
In general, it's good if an initialization function leaves the object unchanged when it fails. While this change doesn't do that, it seems okay.
sr=darin
Attachment #214666 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Updated•19 years ago
|
Whiteboard: [checkin needed]
Updated•19 years ago
|
Attachment #214666 -
Flags: approval-branch-1.8.1?(darin)
Comment 4•19 years ago
|
||
Checking in intl/uconv/src/nsConverterOutputStream.cpp;
/cvsroot/mozilla/intl/uconv/src/nsConverterOutputStream.cpp,v <-- nsConverterOutputStream.cpp
new revision: 1.3; previous revision: 1.2
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Updated•19 years ago
|
Attachment #214666 -
Flags: approval-branch-1.8.1?(darin) → approval-branch-1.8.1+
Comment 5•19 years ago
|
||
checked in on MOZILLA_1_8_BRANCH
Checking in intl/uconv/src/nsConverterOutputStream.cpp;
/cvsroot/mozilla/intl/uconv/src/nsConverterOutputStream.cpp,v <-- nsConverterOutputStream.cpp
new revision: 1.1.4.2; previous revision: 1.1.4.1
done
Keywords: fixed1.8.1
Updated•19 years ago
|
Severity: normal → critical
OS: Windows XP → All
Hardware: PC → All
You need to log in
before you can comment on or make changes to this bug.
Description
•