Closed Bug 122904 Opened 18 years ago Closed 18 years ago

uninitialized nsresult's may be returned by several functions in content/html/document/src

Categories

(Core :: HTML: Parser, defect)

x86
Linux
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: mozilla-bugs, Assigned: radha)

References

Details

There are 3 "xxx might be used uninitialized in this function" warnings in
content/html/document/src:

content/html/document/src/nsHTMLDocument.cpp:561
 `nsresult rv' might be used uninitialized in this function

content/html/document/src/nsWyciwygChannel.cpp:353
 `nsresult rv' might be used uninitialized in this function

content/html/document/src/nsWyciwygChannel.cpp:563
 `nsresult rv' might be used uninitialized in this function

The first one have been there for a while, and the last two were introduced by
today's commit by radha@netscape.com for bug 35340.

All three seem to be real bugs:

- nsHTMLDocument::TryUserForcedCharset will try applying NS_SUCCEEDED to an
uninitialized rv when aMarkupDV is null

- nsWyciwygChannel::WriteToCache will return an uninitialized nsresult if
mCacheOutputStream is null and mCacheTransport is not.

- nsWyciwygChannel::Connect will return an uninitialized nsresult if passed
aFirstTime=PR_FALSE while mCacheEntry is null

P.S. Note that there is something else wrong with
nsWyciwygChannel::WriteToCache, the code there is

if (!mCacheTransport && !mCacheOutputStream) {
    ...

    if (mCacheTransport)
      ...;    
  }

Obviously, the second if statement is dead code.
Bug 59652 is a tracking bug for "xxx might be used uninitialized in this
function" warnings. It also has some additional information on this issue.
Blocks: 59652
nsHTMLDocument.cpp warning was fixed by a recent check-in, now only
nsWyciwygChannel.cpp warnings are left.
Taking from harish. I have the patch ready  as part of anotehr bug and will
checkin shortly. 
Assignee: harishd → radha
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.9
fix checked in. 
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Patch is not attached here, Aleksey: can you please verify this fix, Thanks.
Yes, there are currently no "xxx may be used uninitialized" warnings in
content/html/document, so marking as VERIFIED.

P.S. I thought I'd mention the warnings that are there in the rest of content/
just in case somebody here knows how to fix them as well:

content/base/src/nsSelection.cpp:2250
 `class nsIFrame * thisBlock' might be used uninitialized in this function

content/html/style/src/nsCSSParser.cpp:2861
 `enum nsCSSUnit units' might be used uninitialized in this function

content/html/style/src/nsRuleNode.cpp:1793
 `enum nsSystemFontID sysID' might be used uninitialized in this function

content/html/style/src/nsRuleNode.cpp:4103
 `enum nsStyleContentType type' might be used uninitialized in this function

content/shared/src/nsStyleUtil.cpp:415
 `PRInt32 * column' might be used uninitialized in this function

content/xul/templates/src/nsTemplateMatchSet.cpp:257
 `class nsTemplateMatch ** last' might be used uninitialized in this function



Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.