Closed
Bug 1151181
Opened 9 years ago
Closed 9 years ago
uninitialized error string in mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
Categories
(MailNews Core :: Composition, defect)
Tracking
(thunderbird38+ fixed, thunderbird39 fixed, thunderbird40 fixed, seamonkey2.35 fixed, seamonkey2.36 fixed)
RESOLVED
FIXED
Thunderbird 40.0
People
(Reporter: aceman, Assigned: aceman)
References
Details
(Keywords: regression)
Attachments
(1 file, 3 obsolete files)
1.75 KB,
patch
|
aceman
:
review+
rkent
:
approval-comm-aurora+
rkent
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1149320 comment 2 +++ Found by a subtle compile warning: mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp:1133:83: warning: 'exitString' may be used uninitialized in this function [-Wmaybe-uninitialized] bundle->FormatStringFromName(exitString, params, 1, getter_Copies(failed_msg));
neil@parkwaycc.co.uk 2015-04-01 18:45:09 CEST Comment on attachment 8585742 [details] [diff] [review] [diff] [review] patch > switch (aExitCode) > { > case NS_ERROR_UNKNOWN_HOST: > case NS_ERROR_UNKNOWN_PROXY_HOST: > exitString = MOZ_UTF16("smtpSendFailedUnknownServer"); > break; > case NS_ERROR_CONNECTION_REFUSED: >@@ -1099,16 +1099,19 @@ NS_IMETHODIMP nsMsgMdnGenerator::OnStopR > exitString = MOZ_UTF16("smtpPasswordUndefined"); > break; > default: > if (aExitCode != NS_ERROR_ABORT && !NS_IS_MSG_ERROR(aExitCode)) > exitString = MOZ_UTF16("smtpSendFailedUnknownReason"); > break; > } As the compiler points out, the string is not set for NS_ERROR_ABORT or any NS_IS_MSG_ERROR error. Do we already have strings for those errors? Is there a function somewhere we can call to get the string name of those errors?
:aceman 2015-04-04 10:55:21 CEST (In reply to neil@parkwaycc.co.uk from comment #6) > (In reply to aceman from comment #5) > Aha, I found it. > > It's called errorStringNameForErrorCode. > > Sounds familiar to anyone? Yeah, you seem to be right. Before bug 952493 the aExitCode was preserved in the "default" case and passed on to FormatStringFromID. After the bug, the exitString is left empty if the aExitCode is ABORT or one of the MSG errors. That is a regression.
Component: Backend → Composition
Keywords: regression
Updated•9 years ago
|
tracking-thunderbird38:
--- → +
xpcshell tests passed for me locally. mozmill does not run as a whole so I can't say.
Attachment #8588288 -
Flags: review?(rkent)
Attachment #8588288 -
Flags: review?(neil)
Comment 4•9 years ago
|
||
Comment on attachment 8588288 [details] [diff] [review] patch > case NS_ERROR_SMTP_PASSWORD_UNDEFINED: > exitString = MOZ_UTF16("smtpPasswordUndefined"); > break; > default: >- if (aExitCode != NS_ERROR_ABORT && !NS_IS_MSG_ERROR(aExitCode)) >+ if (NS_IS_MSG_ERROR(aExitCode)) >+ exitString = errorStringNameForErrorCode(aExitCode); >+ else > exitString = MOZ_UTF16("smtpSendFailedUnknownReason"); > break; Interestingly errorStringNameForErrorCode already defaults to smtpSendFailedUnknownReason, so you don't actually need to special-case it. It also knows about NS_ERROR_SMTP_PASSWORD_UNDEFINED so you can fold that case in too. (I don't have any better ideas for NS_ERROR_ABORT though.)
Yes, good ideas.
Attachment #8588288 -
Attachment is obsolete: true
Attachment #8588288 -
Flags: review?(rkent)
Attachment #8588288 -
Flags: review?(neil)
Attachment #8588370 -
Flags: review?(neil)
Comment 6•9 years ago
|
||
Comment on attachment 8588370 [details] [diff] [review] patch v2 > default: >+ exitString = errorStringNameForErrorCode(aExitCode); >- if (aExitCode != NS_ERROR_ABORT && !NS_IS_MSG_ERROR(aExitCode)) >- exitString = MOZ_UTF16("smtpSendFailedUnknownReason"); >- break; > } Please restore the break;
Attachment #8588370 -
Flags: review?(neil) → review+
Attachment #8588370 -
Attachment is obsolete: true
Attachment #8589889 -
Flags: review+
Keywords: checkin-needed
Comment 9•9 years ago
|
||
This patch has bitrotted, please update it (and set again the 'checkin-needed' keyword).
Flags: needinfo?(acelists)
Keywords: checkin-needed
Assignee | ||
Comment 10•9 years ago
|
||
Thanks, updated. Clash with Suyash's string fixes :) This is also an error string fix needed for TB38.
Attachment #8589889 -
Attachment is obsolete: true
Flags: needinfo?(acelists)
Attachment #8592402 -
Flags: review+
Keywords: checkin-needed
Comment 11•9 years ago
|
||
https://hg.mozilla.org/comm-central/rev/d41f334331bf
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-thunderbird38:
--- → affected
status-thunderbird39:
--- → affected
status-thunderbird40:
--- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 38.0
Updated•9 years ago
|
Attachment #8592402 -
Flags: approval-comm-beta?
Attachment #8592402 -
Flags: approval-comm-aurora?
Comment 12•9 years ago
|
||
Please set the target milestone to match the first revision where the patch landed, in this case Thunderbird 40. The affected flags are for other revisions. Yes it is badly misnamed.
Target Milestone: Thunderbird 38.0 → Thunderbird 40.0
Comment 13•9 years ago
|
||
Comment on attachment 8592402 [details] [diff] [review] patch v2.2 https://hg.mozilla.org/releases/comm-aurora/rev/47a68d5136bb https://hg.mozilla.org/releases/comm-beta/rev/662ccf7959bc
Attachment #8592402 -
Flags: approval-comm-beta?
Attachment #8592402 -
Flags: approval-comm-beta+
Attachment #8592402 -
Flags: approval-comm-aurora?
Attachment #8592402 -
Flags: approval-comm-aurora+
Updated•9 years ago
|
status-seamonkey2.35:
--- → fixed
status-seamonkey2.36:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•