Closed
Bug 11580
Opened 25 years ago
Closed 25 years ago
[code] nsMsgIdentity::getCharPref (and other methods) use m_prefs even if it is null
Categories
(MailNews Core :: Backend, defect, P2)
MailNews Core
Backend
Tracking
(Not tracked)
VERIFIED
FIXED
M9
People
(Reporter: jband_mozilla, Assigned: alecf)
Details
It is painful to bulletproof everything. But... Components expxosed to JS can be instantiated and have methods called and attributes twiddled even if their 'normal' custom initilization has not been run. This will crash if the following code is run using xpcshell... var name = "component://netscape/messenger/identity"; try { var foo = Components.classes[name].createInstance(); print(foo); print(name); for(p in Components.interfaces) { try { iface = foo.QueryInterface(Components.interfaces[p]); if(typeof(iface) == 'undefined') continue; print("\t"+p); for(m in iface) { print("\t\t"+m+" = "+typeof(iface[m])); } } catch(e) { } } foo = null; gc(); } catch(e) { print("caught+e"); }
Reporter | ||
Comment 1•25 years ago
|
||
Same story for nsMsgIncomingServer using the above code with: var name = "component://netscape/messenger/server&type=pop3";
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Priority: P3 → P2
Target Milestone: M10
Assignee | ||
Comment 2•25 years ago
|
||
yeah, this is kind of what prefService() was supposed to handle in that other bug you filed. Once again, I should just be using NS_WITH_SERVICE..
Assignee | ||
Updated•25 years ago
|
Summary: nsMsgIdentity::getCharPref (and other methods) use m_prefs even if it is null → [code] nsMsgIdentity::getCharPref (and other methods) use m_prefs even if it is null
Assignee | ||
Updated•25 years ago
|
Target Milestone: M10 → M9
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 3•25 years ago
|
||
ok, nsMsgIdentity was actually fixed for M9.
Ran the sample code in xpcshell using a debug build on Windows NT from today (10/11/99). Since all of the objects were defined, the problem has been resolved. Confirmed with Alec. VERIFIED D:\mozilla\dist\WIN32_D.OBJ\bin>xpcshell nsNativeComponentLoader: autoregistering D:\mozilla\dist\WI nts nsNativeComponentLoader: autoregistering succeeded js> var name = "component://netscape/messenger/identity"; js> js> try { var foo = Components.classes[name].createInstance(); print(foo); print(name); for(p in Components.interfaces) { try { iface = foo.QueryInterface(Components.interface if(typeof(iface) == 'undefined') continue; print("\t"+p); for(m in iface) { print("\t\t"+m+" = "+typeof(iface[m])); } } catch(e) { } } foo = null; gc(); } catch(e) { print("caught+e"); } [xpconnect wrapped nsISupports] component://netscape/messenger/identity nsISupports QueryInterface = function nsIMsgIdentity QueryInterface = function key = string identityName = string fullName = object email = object replyTo = object organization = object composeHtml = boolean attachSignature = boolean attachVCard = boolean signature = object vCard = object doFcc = boolean fccFolder = object bccSelf = boolean bccOthers = boolean bccList = object draftFolder = object stationaryFolder = object junkMailFolder = object toString = function before 23184, after 8262, break 00000000
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•