fepitre / rpms / gtk3

Forked from rpms/gtk3 4 years ago
Clone

Blame SOURCES/0002-gtkbuilderparser-Add-some-assertions.patch

25dd04
From 9fb727d989c3224476b1f8ba435a2d8443f5b625 Mon Sep 17 00:00:00 2001
25dd04
From: Matthias Clasen <mclasen@redhat.com>
25dd04
Date: Fri, 17 Jul 2015 15:52:22 -0400
25dd04
Subject: [PATCH 2/7] gtkbuilderparser: Add some assertions
25dd04
25dd04
Add some assertions that things are non-NULL when we know they
25dd04
are, so that coverity gets it.
25dd04
---
25dd04
 gtk/gtkbuilderparser.c | 3 +++
25dd04
 1 file changed, 3 insertions(+)
25dd04
25dd04
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
25dd04
index ad44011..f85389a 100644
25dd04
--- a/gtk/gtkbuilderparser.c
25dd04
+++ b/gtk/gtkbuilderparser.c
25dd04
@@ -1216,6 +1216,8 @@ end_element (GMarkupParseContext *context,
25dd04
       PropertyInfo *prop_info = state_pop_info (data, PropertyInfo);
25dd04
       CommonInfo *info = state_peek_info (data, CommonInfo);
25dd04
 
25dd04
+      g_assert (info != NULL);
25dd04
+
25dd04
       /* Normal properties */
25dd04
       if (strcmp (info->tag.name, "object") == 0 ||
25dd04
 	  strcmp (info->tag.name, "template") == 0)
25dd04
@@ -1252,6 +1254,7 @@ end_element (GMarkupParseContext *context,
25dd04
     {
25dd04
       SignalInfo *signal_info = state_pop_info (data, SignalInfo);
25dd04
       ObjectInfo *object_info = (ObjectInfo*)state_peek_info (data, CommonInfo);
25dd04
+      g_assert (object_info != NULL);
25dd04
       signal_info->object_name = g_strdup (object_info->id);
25dd04
       object_info->signals =
25dd04
         g_slist_prepend (object_info->signals, signal_info);
25dd04
-- 
25dd04
2.4.5
25dd04