diff options
author | Varsha Rao <rvarsha016@gmail.com> | 2017-09-20 21:53:09 +0530 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-09-27 14:04:00 +0200 |
commit | 72386012200a96f9bb721ab4ddb5a9325c68c5f7 (patch) | |
tree | d8ddea63dba57671d2edbf4a34850d5f9613e567 /src/obj/quota.c | |
parent | 676ea569bbe5abf750d9ed516f35c017efbdce5f (diff) |
src: Buffer is null terminated.
In _snprintf() functions definition the buffer is null terminated.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/obj/quota.c')
-rw-r--r-- | src/obj/quota.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/obj/quota.c b/src/obj/quota.c index d5757b2..6d36784 100644 --- a/src/obj/quota.c +++ b/src/obj/quota.c @@ -179,6 +179,9 @@ static int nftnl_obj_quota_snprintf(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e) { + if (len) + buf[0] = '\0'; + switch (type) { case NFTNL_OUTPUT_DEFAULT: return nftnl_obj_quota_snprintf_default(buf, len, e); |