]> granicus.if.org Git - libnl/commitdiff
cache: fix crash in nl_cache_dump_filter() when omitting the params argument
authorThomas Haller <thaller@redhat.com>
Tue, 10 Jun 2014 15:42:31 +0000 (17:42 +0200)
committerThomas Haller <thaller@redhat.com>
Tue, 10 Jun 2014 19:45:52 +0000 (21:45 +0200)
Error found by coverity.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/cache.c

index 541805132efe5d08143b7c6d9559d08454ab8a06..b4f9649c0e4da8b04608fecf1f2b613861a41d73 100644 (file)
@@ -1154,7 +1154,7 @@ void nl_cache_dump_filter(struct nl_cache *cache,
        if (!ops->oo_dump[type])
                return;
 
-       if (params->dp_buf)
+       if (params && params->dp_buf)
                memset(params->dp_buf, 0, params->dp_buflen);
 
        nl_list_for_each_entry(obj, &cache->c_items, ce_list) {