If dnsproxy is not in use, like when connman has been started
with -r option, then the listener_table will be NULL which can
cause crash in hash table lookup call.
---
 src/dnsproxy.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index f698cfd..787500b 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2916,6 +2916,9 @@ int __connman_dnsproxy_add_listener(int index)
        if (index < 0)
                return -EINVAL;
 
+       if (listener_table == NULL)
+               return 0;
+
        if (g_hash_table_lookup(listener_table, GINT_TO_POINTER(index)) != NULL)
                return 0;
 
-- 
1.7.11.4

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to