Closed
Bug 532108
Opened 15 years ago
Closed 15 years ago
Null pointer dereference or redundant check in mailnews/mime/src/mimei.cpp.
Categories
(MailNews Core :: MIME, defect)
MailNews Core
MIME
Tracking
(thunderbird3.0 .2-fixed)
RESOLVED
FIXED
Thunderbird 3.1a1
Tracking | Status | |
---|---|---|
thunderbird3.0 | --- | .2-fixed |
People
(Reporter: adam.buchbinder, Assigned: adam.buchbinder)
Details
(Keywords: fixed-seamonkey2.0.4)
Attachments
(1 file, 1 obsolete file)
737 bytes,
patch
|
Bienvenu
:
review+
standard8
:
superreview+
standard8
:
approval-thunderbird3.0.1-
standard8
:
approval-thunderbird3.0.2+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5 Build Identifier: thunderbird-3.0rc1 cppcheck, a static code analysis tool, reported: [comm-1.9.1/mailnews/mime/src/mimei.cpp:1502]: (error) Possible null pointer dereference: options - otherwise it is redundant to check if options is null at line 1505 Reproducible: Always In mime_parse_url_options(), the 'options' argument is a pointer. It's used by calling "options->headers" before being checked with "if (!options)". If it's expected that options could be null, the assignment to default_headers should be moved below the check; if it's can never be null, the check is redundant and can be removed. Either way, the test as it stands does nothing; if 'options' is null, it will simply lead to a null pointer reference and subsequent crash. I'm marking this as minor, because I haven't been able to generate an actual crash. Please advise if I should mark this sort of issue with a different severity.
Updated•15 years ago
|
Component: General → MIME
Product: Thunderbird → MailNews Core
QA Contact: general → mime
Assignee | ||
Updated•15 years ago
|
OS: Linux → All
Hardware: x86 → All
Assignee | ||
Comment 1•15 years ago
|
||
I've used the simplest change; the assignment now occurs after the check, so it's safe against 'options' being null.
Attachment #419718 -
Flags: superreview?(bugzilla)
Attachment #419718 -
Flags: review?(bienvenu)
Assignee | ||
Updated•15 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•15 years ago
|
||
Comment on attachment 419718 [details] [diff] [review] Patch to move the assignment below the check. thx for the patch, Adam - mozilla style would be to move the declaration to be with the assignment, instead of splitting them up. r=me with that change.
Attachment #419718 -
Flags: review?(bienvenu) → review-
Assignee | ||
Comment 3•15 years ago
|
||
Edited the patch so that the assignment is together with the declaration, per Mozilla style.
Assignee: nobody → adam.buchbinder
Attachment #419718 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #419902 -
Flags: superreview?(bugzilla)
Attachment #419902 -
Flags: review?(bienvenu)
Attachment #419718 -
Flags: superreview?(bugzilla)
Updated•15 years ago
|
Attachment #419902 -
Flags: review?(bienvenu) → review+
Comment 4•15 years ago
|
||
Comment on attachment 419902 [details] [diff] [review] Move the assignment below the check [Checkin: Comment 5 & 7] thx, Adam.
Updated•15 years ago
|
Attachment #419902 -
Flags: superreview?(bugzilla) → superreview+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 5•15 years ago
|
||
Comment on attachment 419902 [details] [diff] [review] Move the assignment below the check [Checkin: Comment 5 & 7] http://hg.mozilla.org/comm-central/rev/3ed8bb7b219b
Attachment #419902 -
Attachment description: Patch to move the assignment below the check. → Move the assignment below the check
[Checkin: Comment 5]
Attachment #419902 -
Flags: approval-thunderbird3.0.1?
Updated•15 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.1a1
Version: unspecified → Trunk
Comment 6•15 years ago
|
||
Comment on attachment 419902 [details] [diff] [review] Move the assignment below the check [Checkin: Comment 5 & 7] We're not seeing any crashers in this area currently. We've already got a significant amount for 3.0.1 so I don't want to add this as well even thought it may be small.
Attachment #419902 -
Flags: approval-thunderbird3.0.2?
Attachment #419902 -
Flags: approval-thunderbird3.0.1?
Attachment #419902 -
Flags: approval-thunderbird3.0.1-
Updated•14 years ago
|
Attachment #419902 -
Flags: approval-thunderbird3.0.2? → approval-thunderbird3.0.2+
Comment 7•14 years ago
|
||
Checked in: http://hg.mozilla.org/releases/comm-1.9.1/rev/b3812420fcab
status-thunderbird3.0:
--- → .2-fixed
Updated•14 years ago
|
Attachment #419902 -
Attachment description: Move the assignment below the check
[Checkin: Comment 5] → Move the assignment below the check
[Checkin: Comment 5 & 7]
Updated•14 years ago
|
Keywords: fixed-seamonkey2.0.4
You need to log in
before you can comment on or make changes to this bug.
Description
•