Closed Bug 609165 Opened 14 years ago Closed 14 years ago

Crash with nsIFile.contains when passed a null file reference (Mac OS X)

Categories

(Core :: XPCOM, defect)

1.9.2 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b3

People

(Reporter: twhitema, Unassigned)

References

Details

(Keywords: crash)

JS Code to reproduce this:

var file = Components.classes["@mozilla.org/file/local;1"].  
                     createInstance(Components.interfaces.nsILocalFile);  
file.initWithPath("/tmp");
file.contains(null, true); /* crashes here */

Crash report here:
http://crash-stats.mozilla.com/report/index/bp-7adcbd2f-3139-46e4-a7d5-926dd2101102

Tested on Firefox 3.6.12, Mac OS X 10.6.4
Indeed, the old Mac nsLocalFile code didn't null check the inFile argument to contains:
http://hg.mozilla.org/releases/mozilla-1.9.2/annotate/8fe44c79dfd1/xpcom/io/nsLocalFileOSX.mm#l1084

This was fixed on trunk by bug 571193.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Depends on: 571193
Keywords: crash
Target Milestone: --- → mozilla2.0b3
You need to log in before you can comment on or make changes to this bug.