Closed Bug 40094 Opened 25 years ago Closed 25 years ago

Crash if IMG SRC has typo in hostname portion

Categories

(Core :: DOM: Navigation, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sidr, Assigned: adamlock)

References

()

Details

(Keywords: crash, verifyme, Whiteboard: [nsbeta2+][6/15])

Attachments

(1 file)

Overview: A document with an <IMG> whose SRC is at a URL at a host not findable in DNS will crash the browser. This blocks testing for bug 39788, "bad url in image tag displays dialog". Steps to reproduce: 1. View http://bugzilla.mozilla.org/showattachment.cgi?attach_id=8956, which contains <img src="http://www.ntscape.com/hello.gif" alt="hello"> Actual Result: Crash. Talback Incident ID: TB10944105Q Expected result: the ALT text should display as the SRC won't fetch anything. Tested with: The 2000-05-21-08-M16 nightly bianry on WinNT. Additional Information: Typing http://www.ntscape.com/hello.gif into the URL bar results in an alert reading" www.ntscape.com could not be found..."; no crash. Guessing wildly that this is an "HTML Element" problem.
Keywords: crash, nsbeta2
Blocks: 39788
Keywords: nsbeta2nsbeta3
I just tried this and it is fine for me, on WinNT with a local pull from Friday. I also downloaded the 5/22 daily and it does crash there, however only when I download the testcase to a local file... Anyway, the problem is that the method nsWebShell::OnEndDocumentLoad is calling: PRUnichar *msg = nsTextFormatter::smprintf(messageStr, (const char*)host); if (!msg) return NS_ERROR_OUT_OF_MEMORY; with host being null - the smprintf assumes the param is non-null, dereferences it and we crash. A simple check for null should be made here... I'll attach a patch to this bug. I also think this should be nsbeta2 so I'm changing the keyword - it is a crash that is going to be somewhat common I think (misspelled or otherwise invalid DNS entries?)
Assignee: clayton → adamlock
Component: HTML Element → Embedding: Docshell
Keywords: nsbeta3nsbeta2
QA Contact: petersen → adamlock
Hi, do you want to check this in yourself or should I do it?
Putting on [nsbeta2+][6/15] radar.
Whiteboard: [nsbeta2+][6/15]
lock has a fix
Target Milestone: --- → M16
Fix checked in. Approved by Jud
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
build 2000062008 no longer crash when loading the URL above ( testcase attach_id 8956)
Adding verifyme keyword.
Keywords: verifyme
Yep..I loaded too, looks good with Win32 2000-07-18-11 build. marking Verified
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: