cache: fix crash in nl_cache_dump_filter() when omitting the params argument

Error found by coverity.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-06-10 17:42:31 +02:00
parent 8532ac5e10
commit dae0a2316e

View 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) {