Bug 142730 - Potentially uninitialized Inspector values
Summary: Potentially uninitialized Inspector values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-16 10:29 PDT by Brent Fulgham
Modified: 2015-03-16 11:24 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.34 KB, patch)
2015-03-16 10:32 PDT, Brent Fulgham
joepeck: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>