diff options
author | Denis Kenzior <denkenz@gmail.com> | 2013-10-01 11:35:27 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2013-10-01 11:35:27 -0500 |
commit | 2158249069ad9f56614e874c36147ba68364913f (patch) | |
tree | 7938221fafd00116ecdf24e43ea50151cb9ff467 /plugins | |
parent | c49ed15a8fcf85a4adc00f5ba4e08e08de9a173e (diff) | |
download | ofono-2158249069ad9f56614e874c36147ba68364913f.tar.bz2 |
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.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/hfp_hf_bluez5.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c index cd8f75ec..18ed348a 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, |