[gtk+] cssbordervalue: Fix possible use of uninitialised



commit eddbfc65a9a5752ea70c99c390b07a922abc01d3
Author: Daniel Boles <dboles src gnome org>
Date:   Tue Aug 1 19:31:20 2017 +0100

    cssbordervalue: Fix possible use of uninitialised
    
    If value->values[i] is NULL, then values[i] was left uninitialised.
    The code then reads each element of values[].
    
    CID 1432029 (#1 of 1): Uninitialized pointer read (UNINIT)
    11. uninit_use: Using uninitialized value values[i].

 gtk/gtkcssbordervalue.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssbordervalue.c b/gtk/gtkcssbordervalue.c
index 5140057..d95196c 100644
--- a/gtk/gtkcssbordervalue.c
+++ b/gtk/gtkcssbordervalue.c
@@ -60,6 +60,10 @@ gtk_css_value_border_compute (GtkCssValue             *value,
           values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
           changed |= (values[i] != value->values[i]);
         }
+      else
+        {
+          values[i] = NULL;
+        }
     }
 
   if (!changed)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]