Closed Bug 127289 Opened 18 years ago Closed 18 years ago

nsMsgThread::GetFirstUnreadChild code path returns uninitialized value

Categories

(MailNews Core :: Database, defect, P5, trivial)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: timeless, Assigned: Bienvenu)

References

Details

Attachments

(1 file)

follow this path: 

1045 NS_IMETHODIMP nsMsgThread::GetFirstUnreadChild(nsIMsgDBHdr **result)
1049   nsresult rv;
1051     GetNumChildren(&numChildren);
make a path where numChildren is not positive.
1053     if ((PRInt32) numChildren < 0)
1054         numChildren = 0;
1056     for (PRUint32 childIndex = 0; childIndex < numChildren; childIndex++)
nothing happens here
1076     return rv;
1077 }
This would only happen if the thread was empty (i.e., no messages). If the
thread is empty, we don't call this routine anyway in any case that we care
about the return value (we care about the result). So, marking trivial.
Severity: normal → trivial
Priority: -- → P5
Attached patch proposed fixSplinter Review
just init rv to NS_OK - callers need to (and do) check for non-null result.
Navin, can I get a review? thx.
Comment on attachment 83752 [details] [diff] [review]
proposed fix

r=naving
Attachment #83752 - Flags: review+
fix checked in, sr=sspitzer.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Blocks: 59652
V, warning is no longer there in
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1021577100.8769.gz&fulltext=1
(Thu, 16 May 2002 15:25 -0400)
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.