Bug 142730

Summary: Potentially uninitialized Inspector values
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: Web InspectorAssignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch joepeck: review+

Description Brent Fulgham 2015-03-16 10:29:44 PDT
In an effort to locate and resolve some WebInspector crashes I'm seeing on Windows, I wanted to clean up some of the warning MSVC and its analyzer are complaining about.

The 'InspectorObjectBase::getInteger' can return false without setting its return value to anything. This leaves arguments in a potentially uninitialized state:

source\webcore\inspector\inspectordomagent.cpp(119): warning C4701: potentially uninitialized local variable 'g' used
source\webcore\inspector\inspectordomagent.cpp(119): warning C4701: potentially uninitialized local variable 'b' used
Comment 1 Radar WebKit Bug Importer 2015-03-16 10:30:05 PDT
<rdar://problem/20174405>
Comment 2 Brent Fulgham 2015-03-16 10:32:31 PDT
Created attachment 248731 [details]
Patch
Comment 3 Joseph Pecoraro 2015-03-16 11:20:35 PDT
Comment on attachment 248731 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248731&action=review

r=me

> Source/WebCore/inspector/InspectorDOMAgent.cpp:117
> -    double a;
> +    double a = 0;

Maybe "1" would be a better default.
Comment 4 Brent Fulgham 2015-03-16 11:22:29 PDT
Comment on attachment 248731 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248731&action=review

>> Source/WebCore/inspector/InspectorDOMAgent.cpp:117
>> +    double a = 0;
> 
> Maybe "1" would be a better default.

Good point! I'll fix that.
Comment 5 Brent Fulgham 2015-03-16 11:24:25 PDT
Committed r181568: <http://trac.webkit.org/changeset/181568>