Potentially uninitialized Inspector values
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Mar 2015 18:23:54 +0000 (18:23 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Mar 2015 18:23:54 +0000 (18:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142730

Reviewed by Joseph Pecoraro.

* inspector/InspectorDOMAgent.cpp:
(WebCore::parseColor): Make sure color values are given an initial value.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorDOMAgent.cpp

index 856a581..8b4ac9a 100644 (file)
@@ -1,3 +1,13 @@
+2015-03-16  Brent Fulgham  <bfulgham@apple.com>
+
+        Potentially uninitialized Inspector values
+        https://bugs.webkit.org/show_bug.cgi?id=142730
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::parseColor): Make sure color values are given an initial value.
+
 2015-03-16  Brady Eidson  <beidson@apple.com>
 
         URLs visited during private browsing show up in WebpageIcons.db
index 0b8f941..1f3d3fa 100644 (file)
@@ -108,13 +108,13 @@ static Color parseColor(const RefPtr<InspectorObject>&& colorObject)
     if (!colorObject)
         return Color::transparent;
 
-    int r;
-    int g;
-    int b;
+    int r = 0;
+    int g = 0;
+    int b = 0;
     if (!colorObject->getInteger("r", r) || !colorObject->getInteger("g", g) || !colorObject->getInteger("b", b))
         return Color::transparent;
 
-    double a;
+    double a = 1.0;
     if (!colorObject->getDouble("a", a))
         return Color(r, g, b);