Closed Bug 156307 Opened 24 years ago Closed 24 years ago

Mail doesn't create a title tag for print document

Categories

(Core :: Printing: Output, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 156650
mozilla1.0.1

People

(Reporter: rods, Assigned: rods)

Details

(Keywords: crash)

Attachments

(1 file, 4 obsolete files)

Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1
Attached patch patch (obsolete) — — Splinter Review
simply creates a "title" tag with the subject in it. This enables the printed mail msgs to display the subject as the title in the progress dialog and on the printed page
Comment on attachment 90519 [details] [diff] [review] patch This is not good at all as the subject of a messager can contains <...> data which could be interpretted as html. We need first to call nsEscapeHTML to sanitize the subject. Don't need to check mDocHeader, we check already for it 3 line above. Also, should we free val?
Attachment #90519 - Flags: needs-work+
Attached patch Proposed fix, v2 (obsolete) — — Splinter Review
This patch takes care of my concerns. Rods, can you test it to see if it solves your problem?
Attachment #90519 - Attachment is obsolete: true
Comment on attachment 90536 [details] [diff] [review] Proposed fix, v2 wow, my patch was embaressingly bad, I guess I really shouldn't work on a holiday weekend :) This patch works great r=rods
Attachment #90536 - Flags: review+
Comment on attachment 90536 [details] [diff] [review] Proposed fix, v2 I think we're just using strlen, not nsCRT::strlen, for char *'s - other than that, sr=bienvenu
Attachment #90536 - Flags: superreview+
Comment on attachment 90536 [details] [diff] [review] Proposed fix, v2 since you know the length of buf, how about using snprintf which is safer. subject is a char *, so use strlen(), instead of nsCRT::strlen()
Attachment #90536 - Flags: superreview+
Attached patch Proposed fix, v3 (obsolete) — — Splinter Review
Addressed reviewers' comment.
Attachment #90536 - Attachment is obsolete: true
Comment on attachment 90539 [details] [diff] [review] Proposed fix, v3 carry over r=rods
Attachment #90539 - Flags: review+
Comment on attachment 90539 [details] [diff] [review] Proposed fix, v3 isn't the <title> supposed to come after the <html> and <head> tags?
Rods, can you answer comment #9
Attached patch Proposed fix, v4 (obsolete) — — Splinter Review
ok, eberything should be in the right place now and note that it is using PR_snprintf
Comment on attachment 90555 [details] [diff] [review] Proposed fix, v4 R=ducarroz
Attachment #90555 - Flags: review+
Comment on attachment 90555 [details] [diff] [review] Proposed fix, v4 sr=sspitzer, once you fix PR_Free(subject) to be nsMemory::Free(subject) nsEscapeHTML() allocates with nsMemory::Alloc(), so we need to use nsMemory::Free()
Attachment #90555 - Flags: review+ → superreview+
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
this fix caused bug 156650. If you plane to land this fix in the branch, you will have to land fix for bug 156650 too.
new topcrash, rank 8, due to the patch checked in. the talkback team apologizes for not having line numbers (it will be remedied soon), nevertheless, below is the call stack: nsEscapeHTML() nsMimeHtmlDisplayEmitter::EndHeader() mimeEmitterEndHeader() MimeMessage_write_headers_html() MimeMessage_close_headers() MimeMessage_parse_line() convert_and_send_buffer() mime_LineBuffer() MimeObject_parse_buffer() mime_display_stream_write() nsStreamConverter::OnDataAvailable() nsDocumentOpenInfo::OnDataAvailable() nsMailboxProtocol::ReadMessageResponse() nsMailboxProtocol::ProcessProtocolState() nsMsgProtocol::OnDataAvailable() nsOnDataAvailableEvent::HandleEvent() nsARequestObserverEvent::HandlePLEvent() PL_HandleEvent() PL_ProcessEventsBeforeID() processQueue() nsVoidArray::EnumerateForwards() nsAppShell::ProcessBeforeID() handle_gdk_event() libgdk-1.2.so.0 + 0x17dd4 (0x4035ddd4) libglib-1.2.so.0 + 0x10c46 (0x4038fc46) libglib-1.2.so.0 + 0x11273 (0x40390273) libglib-1.2.so.0 + 0x1143c (0x4039043c) libgtk-1.2.so.0 + 0x9276c (0x402a876c) nsAppShell::Run() nsAppShellService::Run() main1() main() libc.so.6 + 0x1d7ee (0x404ba7ee) could it be that |GetHeaderValue| is returning garbage? in nsMimeHtmlEmitter.cpp: 312 char *subject = nsEscapeHTML(GetHeaderValue(HEADER_SUBJECT, mHeaderArray));
Severity: normal → blocker
Status: RESOLVED → REOPENED
Keywords: crash, zt4newcrash
Resolution: FIXED → ---
we have an open bug for the crash already (bug 156650) Don't need to reopen this one...
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
QA Contact: sujay → esther
Note for qa when verifying the original problem noted in this bug: The fix is to replace the http location title at the top right side of the printed mail message with the Subject of the message being printed.
fix was bad
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
Attached patch patch v5 — — Splinter Review
Now we make sure we have a valid string before escaping it.
Attachment #90539 - Attachment is obsolete: true
Attachment #90555 - Attachment is obsolete: true
I have already a fix for the crash which is waiting for trunk approval! see bug 156650
*** Bug 156650 has been marked as a duplicate of this bug. ***
I cannot land the fix I made in bug 156650 as rods backout the fix that cause the crash. Let use this bug now...
Comment on attachment 90877 [details] [diff] [review] patch v5 Instead of having to calculate the size of the string, then allowing a buffer which by the way you are not checking the result, you can just use PR_smprintf...
Bug 156650 already has patch and approvals *** This bug has been marked as a duplicate of 156650 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → DUPLICATE
reversing my inputs
Severity: blocker → normal
Keywords: zt4newcrash
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: