Closed
Bug 1228497
Opened 10 years ago
Closed 10 years ago
[Static Analysis][Uninitialized Members In Class] Class nsCSPParser from nsCSPParser.cpp has 3 member variables unintialized
Categories
(Core :: DOM: Security, defect)
Core
DOM: Security
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1340247)
Attachments
(1 file, 1 obsolete file)
983 bytes,
patch
|
ckerschb
:
review+
|
Details | Diff | Splinter Review |
The Static Analysis tool Coverity added the following in class nsCSPParser:
1. uninit_member: Non-static class member mCurChar is not initialized in this constructor nor in any functions that it calls.
2. uninit_member: Non-static class member mEndChar is not initialized in this constructor nor in any functions that it calls.
3. uninit_member: Non-static class member mPolicy is not initialized in this constructor nor in any functions that it calls.
Assignee | ||
Updated•10 years ago
|
Whiteboard: CID 1340247
Assignee | ||
Comment 1•10 years ago
|
||
Hello Sid,
Could you please take a look other this patch and tell me what you think?
THX
Attachment #8692815 -
Flags: review?(mozbugs)
Assignee | ||
Updated•10 years ago
|
Blocks: coverity-analysis
Comment 2•10 years ago
|
||
Comment on attachment 8692815 [details] [diff] [review]
Bug 1228497.diff
Review of attachment 8692815 [details] [diff] [review]:
-----------------------------------------------------------------
Yeah, I think it would be good to initialize those. Chris, you wrote most of the parser; this makes sense, right?
Attachment #8692815 -
Flags: review?(mozbugs) → review?(mozilla)
Comment 3•10 years ago
|
||
Comment on attachment 8692815 [details] [diff] [review]
Bug 1228497.diff
Review of attachment 8692815 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/security/nsCSPParser.cpp
@@ +131,5 @@
> , mCSPContext(aCSPContext)
> , mDeliveredViaMetaTag(aDeliveredViaMetaTag)
> + , mCurChar(nullptr)
> + , mEndChar(nullptr)
> + , mPolicy(nullptr)
Yeah, that sounds great, but the initialization list needs to match the order of the members in the *.h file, otherwise they will be initialized after object construction.
Attachment #8692815 -
Flags: review?(mozilla)
Assignee | ||
Comment 4•10 years ago
|
||
Thanks for catching that, otherwise the build would have crashed since we are treating this compile warnings as errors, witch is good!
Attachment #8692815 -
Attachment is obsolete: true
Attachment #8697187 -
Flags: review?(mozilla)
Comment 5•10 years ago
|
||
Comment on attachment 8697187 [details] [diff] [review]
Bug 1228497.diff
Review of attachment 8697187 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks, r=me
Attachment #8697187 -
Flags: review?(mozilla) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 7•10 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•