Closed Bug 85981 Opened 24 years ago Closed 24 years ago

nsStdURL::SchemeIs() method doesn't check for null mScheme

Categories

(Core :: Networking, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: cmanske, Assigned: dougt)

References

Details

(Keywords: crash)

Attachments

(1 file)

If you make an nsIURI with a URL that doesn't exist, it seems mScheme is null. It seems that in this line of nsStdURL::SchemeIs(): if ( *i_Scheme == *mScheme || *i_Scheme == (*mScheme - ('a' - 'A')) ) { we should always check for null mScheme. This is hard to demonstrate, but I discovered it testing the fix to bug 78351. It's kind of messy, because you have to apply fixes to bug 78351, bug 76177, and bug 82435 before you can get the crash! If you do that, here's how to show it: Bring up a composer window, click on Image button to bring up dialog. Type "xxxxxxxxx.gif" and BAM! I don't know anything about this code, but looking at nsStdURL.cpp, it certainly looks like there's plenty of opportunity to have a null mScheme, so checking it certainly seems the right thing to do!
Since this is a crasher and blocker, I'm going to take the liberty of marking it "0.9.2"
Blocks: 78351, 82435
Severity: normal → blocker
Keywords: crash
Target Milestone: --- → mozilla0.9.2
Valeski is not around. Reassigning to Radha
Assignee: valeski → radha
Whiteboard: FIX IN HAND need r=, sr=, a=
sr=kin@netscape.com if you get an r= from a module owner/peer.
Whiteboard: FIX IN HAND need r=, sr=, a= → FIX IN HAND need r=, a=
this is necko. it should be assigned to gagan or dougt or darin.
Assignee: radha → gagan
I'm filling in for Jud, when he is not here, but I'm not the module owner for this code. Though the changes look OK to me, It think it is not PC for me to give a review. I also suggest you try dougt/darin/gagan for a review.
r=gagan, get an sr/a and land this in soon...
Whiteboard: FIX IN HAND need r=, a= → FIX IN HAND need sr=, a=
Already sr'd just get a= from drivers@mozilla.org.
Whiteboard: FIX IN HAND need sr=, a= → FIX IN HAND need a=
a= asa@mozilla.org for checkin to the trunk. (on behalf of drivers)
Might as well assign to me since I fixed it.
Fix checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: FIX IN HAND need a=
WAIT!!!! This is NOT something that we want to do!!! The scheme should never be null. I am workin on changing the callers so that this is impossible. Now, I am going to have to back this out.... reopening and reassigning...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
dougt, back this out.
Assignee: gagan → dougt
Status: REOPENED → NEW
Ok, as long a mScheme is assured of being non-null. Maybe adding an assertion would be a good idea?
Priority: -- → P3
fixed checked in.
Status: NEW → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Verified on: Win2K: 2001-07-27-00-0.9.2 2001-07-27-12-trunk MacOS: 2001-07-26-21-0.9.2 Linux: 2001-07-26-23-0.9.2
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: