From: Denis Kenzior Date: Tue, 1 Oct 2013 16:35:27 +0000 (-0500) Subject: hfp_hf_bluez5: Be more pedantic in get_version X-Git-Tag: 1.13~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2158249069ad9f56614e874c36147ba68364913f;p=platform%2Fupstream%2Fofono.git hfp_hf_bluez5: Be more pedantic in get_version If no 'Version' key is found we might be assigning an uninitialized value. Return an error in this case as the 'Version' key is required. --- diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c index cd8f75e..18ed348 100644 --- a/plugins/hfp_hf_bluez5.c +++ b/plugins/hfp_hf_bluez5.c @@ -449,13 +449,14 @@ static int get_version(DBusMessageIter *iter, uint16_t *version) dbus_message_iter_recurse(&entry, &valiter); dbus_message_iter_get_basic(&valiter, &value); - break; - } - if (version) - *version = value; + if (version) + *version = value; - return 0; + return 0; + } + + return -ENOENT; } static DBusMessage *profile_new_connection(DBusConnection *conn,