summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2011-04-10 10:18:04 +0200
committerThomas Graf <tgraf@suug.ch>2011-04-10 10:18:04 +0200
commit2dbe7d7cfc591e4e279f91409dca92f235b92c1b (patch)
treecf0541afa3abc1df37033b5533f92f9929a4f8c0
parent475dffa699da4b3ca722ba7471bce0fdeb6d191e (diff)
downloadlibnl-2dbe7d7cfc591e4e279f91409dca92f235b92c1b.tar.gz
Initialize dump buffer in case caller missed it
(Set an end to all the bug reports of applications failing to do so.)
-rw-r--r--lib/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils.c b/lib/utils.c
index 8756318..4d29ebb 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -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);
}