From 07943b87fac629db2c58281ea1d6e0faad6a2965 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 21 Apr 2017 18:58:39 +0300 Subject: [PATCH] gobex: Make g_obex_apparam_encode NULL safe Make g_obex_apparam_encode ignore if the apparam pointer is NULL. --- gobex/gobex-apparam.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.3