Closed
Bug 351007
Opened 19 years ago
Closed 18 years ago
Crash [@ XPCWrappedNative::CallMethod] passing undefined to idl parameter of type out nsAString
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
People
(Reporter: neil, Assigned: neil)
Details
(Keywords: crash, testcase)
Crash Data
Attachments
(1 file)
|
1.55 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Note: this example is taken from mozilla.dev.extensions so it targets 1.0.x
var f_h = Components.classes["@mozilla.org/satchel/form-history;1"].getService(Components.interfaces.nsIFormHistory);
var f_name;
var f_value;
f_h.getEntryAt (0, f_name, f_value);
nsIFormHistory.idl declares void getEntryAt(in unsigned long index, out AString name, out AString value);
I reproduced the crash with SeaMonkey trunk using the wallet service which includes WALLET_PreEdit(out AString walletList);
It crashes in XPCWrappedNative::CallMethod at the following line of code:
if(!OBJ_SET_PROPERTY(ccx, JSVAL_TO_OBJECT(argv[i]),
rt->GetStringID(XPCJSRuntime::IDX_VALUE), &v))
presumably because argv[i] is zero. Apparently an out AString actually compiles to an in dipper AString which isn't null-checked like other out params are.
| Assignee | ||
Comment 1•19 years ago
|
||
This fixes it for me, instead of crashing I now get an 0x80570002 nsresult.
Comment 2•19 years ago
|
||
(the comment 0 testcase passes undefined, not null)
Summary: Crash passing null to idl parameter of type out nsAString → Crash passing undefined to idl parameter of type out nsAString
| Assignee | ||
Comment 3•19 years ago
|
||
(In reply to comment #2)
>(the comment 0 testcase passes undefined, not null)
It's not as if it makes any difference - the result is the same with 0, undefined, null etc...
Comment 4•19 years ago
|
||
oh... last time I ran into this, only undefined was a problem IIRC.
Comment on attachment 236378 [details] [diff] [review]
Possible patch
seems reasonable to me
Attachment #236378 -
Flags: review?(dbradley)
Updated•19 years ago
|
Assignee: dbradley → nobody
Updated•19 years ago
|
Comment 6•18 years ago
|
||
Marking blocker, I'll sr...
Assignee: nobody → neil
Flags: blocking1.9? → blocking1.9+
Updated•18 years ago
|
Attachment #236378 -
Flags: review?(dbradley) → superreview?(jst)
Comment 7•18 years ago
|
||
Comment on attachment 236378 [details] [diff] [review]
Possible patch
r+sr=jst, let's get this one in.
Attachment #236378 -
Flags: superreview?(jst)
Attachment #236378 -
Flags: superreview+
Attachment #236378 -
Flags: review+
| Assignee | ||
Comment 8•18 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•18 years ago
|
Flags: in-testsuite?
Updated•14 years ago
|
Crash Signature: [@ XPCWrappedNative::CallMethod]
You need to log in
before you can comment on or make changes to this bug.
Description
•