Closed Bug 225570 Opened 21 years ago Closed 21 years ago

nsMsgCompose carefully avoids using GetTypeFromFile

Categories

(MailNews Core :: Composition, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Biesinger, Assigned: Biesinger)

References

()

Details

Attachments

(1 file)

In nsMsgCompose::ProcessSignature:
the code has an nsILocalFile to work with
but, it gets the nativePath from it, inits a filespec with it, then CIs a
nsIFileURL, inits it with the native path, gets the extension from that, and
asks the mimeservice for the type.

it should simply ask the mimeservice for the type of the nsILocalFile. (using
the GetTypeFromFile method)
Attachment #135402 - Flags: review?(mscott)
Status: NEW → ASSIGNED
Attachment #135402 - Flags: review?(mscott) → review?(ducarroz)
Attachment #135402 - Flags: superreview+
Attachment #135402 - Flags: review?(ducarroz) → review?(bienvenu)
Attachment #135402 - Flags: review?(bienvenu) → review?(bzbarsky)
Comment on attachment 135402 [details] [diff] [review]
something like this

r=bzbarsky
Attachment #135402 - Flags: review?(bzbarsky) → review+
Checking in mailnews/compose/src/nsMsgCompose.cpp;
/cvsroot/mozilla/mailnews/compose/src/nsMsgCompose.cpp,v  <--  nsMsgCompose.cpp
new revision: 1.412; previous revision: 1.411
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
This checkin have added a "may be used uninitialized" warning on brad TBox:

+mailnews/compose/src/nsMsgCompose.cpp:3320
+ `nsresult rv' might be used uninitialized in this function

Indeed, if identity is NULL on line 3348, then on line 3385, it will try testing
NS_FAILED on an unitialized rv - see
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/compose/src/nsMsgCompose.cpp&rev=1.412&mark=3348,3385#3320

Should I file a new bug for this or reopen this one?
Fix checked in for the warning.
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: