Closed Bug 949800 Opened 11 years ago Closed 11 years ago

variable 'preventDefaultCalled' is used uninitialized whenever 'if' condition is false

Categories

(Core :: DOM: Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 949353

People

(Reporter: mccr8, Unassigned)

References

Details

(Keywords: csectype-uninitialized, regression)

0:11.04 Warning: -Wsometimes-uninitialized in /Users/amccreight/mc/dom/workers/WorkerPrivate.cpp: variable 'preventDefaultCalled' is used uninitialized whenever 'if' condition is false
 0:11.04 /Users/amccreight/mc/dom/workers/WorkerPrivate.cpp:1235:18: warning: variable 'preventDefaultCalled' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
 0:11.04         else if ((sgo = nsJSUtils::GetStaticScriptGlobal(target))) {
 0:11.04                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 0:11.04 /Users/amccreight/mc/dom/workers/WorkerPrivate.cpp:1251:13: note: uninitialized use occurs here
 0:11.04         if (preventDefaultCalled) {
 0:11.04             ^~~~~~~~~~~~~~~~~~~~
 0:11.04 /Users/amccreight/mc/dom/workers/WorkerPrivate.cpp:1235:14: note: remove the 'if' if its condition is always true
 0:11.04         else if ((sgo = nsJSUtils::GetStaticScriptGlobal(target))) {
 0:11.04              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 0:11.04 /Users/amccreight/mc/dom/workers/WorkerPrivate.cpp:1211:34: note: initialize the variable 'preventDefaultCalled' to silence this warning
 0:11.04         bool preventDefaultCalled;
 0:11.04                                  ^
 0:11.04                                   = false
 0:11.04 1 warning generated.

I don't know if this is a huge problem or not, I'm just setting this a sec-sensitive as a precaution.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Group: core-security
You need to log in before you can comment on or make changes to this bug.