]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Initialize dump buffer in case caller missed it
authorThomas Graf <tgraf@suug.ch>
Sun, 10 Apr 2011 08:18:04 +0000 (10:18 +0200)
committerThomas Graf <tgraf@suug.ch>
Sun, 10 Apr 2011 08:18:04 +0000 (10:18 +0200)
(Set an end to all the bug reports of applications failing
to do so.)

lib/utils.c

index 87563184546b030367b95654cdab757c3a87270e..4d29ebb68d876757a49ccae4ada236d88f3d77f5 100644 (file)
@@ -1000,6 +1000,9 @@ void dump_from_ops(struct nl_object *obj, struct nl_dump_params *params)
                params->dp_pre_dump = 1;
        }
 
+       if (params->dp_buf)
+                memset(params->dp_buf, 0, params->dp_buflen);
+
        if (obj->ce_ops->oo_dump[type])
                obj->ce_ops->oo_dump[type](obj, params);
 }