diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2017-04-21 18:58:39 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2017-04-23 23:12:34 +0300 |
commit | 07943b87fac629db2c58281ea1d6e0faad6a2965 (patch) | |
tree | 4f54ec576de24737d3abf8c40fcb80c7e45379fa /gobex | |
parent | 677a3456afa886e759582a96e1b9d47992b17c52 (diff) | |
download | bluez-07943b87fac629db2c58281ea1d6e0faad6a2965.tar.gz |
gobex: Make g_obex_apparam_encode NULL safe
Make g_obex_apparam_encode ignore if the apparam pointer is NULL.
Diffstat (limited to 'gobex')
-rw-r--r-- | gobex/gobex-apparam.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gobex/gobex-apparam.c b/gobex/gobex-apparam.c index 432817203..b16cee11a 100644 --- a/gobex/gobex-apparam.c +++ b/gobex/gobex-apparam.c @@ -152,6 +152,9 @@ gssize g_obex_apparam_encode(GObexApparam *apparam, void *buf, gsize len) GHashTableIter iter; gpointer key, value; + if (!apparam) + return 0; + g_hash_table_iter_init(&iter, apparam->tags); while (g_hash_table_iter_next(&iter, &key, &value)) { struct apparam_tag *tag = value; |