From: Thomas Graf Date: Sun, 10 Apr 2011 08:18:04 +0000 (+0200) Subject: Initialize dump buffer in case caller missed it X-Git-Tag: libnl3_1~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dbe7d7cfc591e4e279f91409dca92f235b92c1b;p=thirdparty%2Flibnl.git Initialize dump buffer in case caller missed it (Set an end to all the bug reports of applications failing to do so.) --- 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); }