[at-spi2-core: 31/32] dbtest:demarshal() - Assert that the message is iterable, or things will go really bad down the line




commit ae90cda15b5edc23c72f994b4da9b39c965afdd1
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Dec 14 16:14:00 2021 -0600

    dbtest:demarshal() - Assert that the message is iterable, or things will go really bad down the line
    
    Fixes static-scan warnings of this kind:
    
    ../../../dbind/dbtest.c:83:18: warning: The left operand of '==' is a garbage value 
[core.UndefinedBinaryOperatorResult]
        g_assert (v2 == 42);
                  ~~ ^

 dbind/dbtest.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/dbind/dbtest.c b/dbind/dbtest.c
index 085d7ffb..511839c3 100644
--- a/dbind/dbtest.c
+++ b/dbind/dbtest.c
@@ -40,7 +40,10 @@ void demarshal (DBusMessage *msg, const char *type, void *ptr)
     DBusMessageIter iter;
 
     if (!dbus_message_iter_init (msg, &iter))
+      {
         fprintf (stderr, "no data in msg\n");
+        g_assert_not_reached ();
+      }
     else
         dbind_any_demarshal (&iter, &type, &ptr);
 }


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