From a48a49b9c91b6640ce8e39970adc8601bd7f9293 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 9 Aug 2016 16:48:59 +0200 Subject: [PATCH] Initialize 'klass' in _dbus_type_reader_recurse to NULL Initializing 'klass' in _dbus_type_reader_recurse avoids a compile-time warning about the variable being uninitialized. Signed-off-by: Thomas Zimmermann Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97282 --- dbus/dbus-marshal-recursive.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-marshal-recursive.c b/dbus/dbus-marshal-recursive.c index b58a2830..7fe94b09 100644 --- a/dbus/dbus-marshal-recursive.c +++ b/dbus/dbus-marshal-recursive.c @@ -989,8 +989,8 @@ void _dbus_type_reader_recurse (DBusTypeReader *reader, DBusTypeReader *sub) { - const DBusTypeReaderClass *klass; int t; + const DBusTypeReaderClass *klass = NULL; t = _dbus_first_type_in_signature (reader->type_str, reader->type_pos); @@ -1030,6 +1030,7 @@ _dbus_type_reader_recurse (DBusTypeReader *reader, _dbus_assert_not_reached ("don't yet handle recursing into this type"); } + _dbus_assert (klass != NULL); _dbus_assert (klass == all_reader_classes[klass->id]); (* klass->recurse) (sub, reader);