Closed
Bug 66999
Opened 24 years ago
Closed 24 years ago
Crash printing document with no title
Categories
(Core :: Printing: Output, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: ian, Assigned: dcone)
References
()
Details
Attachments
(1 file)
532 bytes,
patch
|
Details | Diff | Splinter Review |
mozilla/layout/base/src/nsDocumentViewer.cpp around line 1497 does: // get the document title const nsString* docTitle = mDocument->GetDocumentTitle(); PRUnichar * docStr = docTitle->ToNewUnicode(); printService->SetTitle(docStr); nsMemory::Free(docStr); This crashes if mDocument->GetDocumentTitle() returns NULL, as it does when printing a picture (or probably an XML file, untested). This requires at least a null pointer check. STEPS TO REPRODUCE 1. Go to an image, for example: http://www.dilbert.com/comics/dilbert/archive/images/dilbert20010121044118.gif 2. Print. ACTUAL RESULTS 1. Laugh at picture. 2. Cry at crash. EXPECTED RESULTS 1. Laugh at picture. 2. Collect printout and stick it to your cube wall. 3. Watch other people laugh at picture. This bug was introduced by Rod's recent checkin, so assigning direct to him.
Comment 1•24 years ago
|
||
reassigning to dcone he has a fix in his tree for this, I have already checked in the fix on the embed branch for this
Assignee: rods → dcone
Assignee | ||
Comment 2•24 years ago
|
||
Fixed
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 4•23 years ago
|
||
The fix for this bug corrects the crash, but introduces other behaviour which is not ideal. Specifically, there are bugs 80799 and 81848 which are mis-listed as duplicates of 71976 but aren't... With this fix, a document with no title will print with the title of the previous printed page. The correct fix for this is actually the fix for 71976, which gets rid of the unprotected check of the title pointer. To fix the stale title, I propose one of two patches. Either allow the title to be null in the print properties, or set it to the empty string if it is null... I am testing patches as I type this... Should I enter this as a new bug, or is one of the bugs mentioned here more appropriate?
Comment 5•23 years ago
|
||
Comment 6•23 years ago
|
||
I filed a new bug for this, Bug: 86558 and included my patch
You need to log in
before you can comment on or make changes to this bug.
Description
•