[PATCH 6/9] cache: fix crash in nl_cache_dump_filter() when omitting the params argument

Thomas Haller thaller at redhat.com
Tue Jun 10 09:59:42 PDT 2014


Error found by coverity.

Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 lib/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cache.c b/lib/cache.c
index 5418051..b4f9649 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -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) {
-- 
1.9.3




More information about the libnl mailing list