If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[Static Analysis][Uninitialized scalar variable] In function CSSParserImpl::ParseDeclarationBlock from nsCSSParser.cpp

RESOLVED FIXED in Firefox 46

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: andi, Assigned: andi)

Tracking

(Blocks: 1 bug, {coverity})

Trunk
mozilla46
coverity
Points:
---

Firefox Tracking Flags

(firefox46 fixed)

Details

(Whiteboard: CID 1323118)

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
The Static Analysis tool Coverity added that variable changed is not initialized:
>>  for (;;) {
>>    bool changed;
>>    if (!ParseDeclaration(declaration, aFlags, true, &changed, aContext)) 

Variable changed is passed by address to ParseDeclaration where it gets used without initialization below:

>>    aDeclaration->AddVariableDeclaration(varName, variableType, variableValue,
                                         status == ePriority_Important, >>false);
 >> } else {
>>    *aChanged |= mData.TransferFromBlock(mTempData, propID,
>>                                         PropertyEnabledState(),
>>                                         status == ePriority_Important,
>>                                         false, aMustCallValueAppended,
>>                                         aDeclaration, GetDocument());

Looking through code this behavior doesn't impact the application since the value stored in that variable it's not used later on, but i would still initialize it in order to silence Coverity.
(Assignee)

Comment 1

2 years ago
Created attachment 8698346 [details] [diff] [review]
Bug 1232596.diff
Attachment #8698346 - Flags: review?(dbaron)
Attachment #8698346 - Flags: review?(dbaron) → review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 2

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/1f2dd0904614
Keywords: checkin-needed

Comment 3

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1f2dd0904614
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox46: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.