From: Thomas Zimmermann Date: Tue, 9 Aug 2016 14:48:59 +0000 (+0200) Subject: Initialize 'klass' in _dbus_type_reader_recurse to NULL X-Git-Tag: dbus-1.11.4~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a48a49b9c91b6640ce8e39970adc8601bd7f9293;p=thirdparty%2Fdbus.git 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 --- diff --git a/dbus/dbus-marshal-recursive.c b/dbus/dbus-marshal-recursive.c index b58a28309..7fe94b091 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);