[dpdk-stable] patch 'cmdline: avoid garbage in unused fields of parsed result' has been queued to LTS release 17.11.1

Yuanhan Liu yliu at fridaylinux.org
Thu Feb 1 10:47:18 CET 2018


Hi,

FYI, your patch has been queued to LTS release 17.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/03/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 32f343066718228b41ba38eb7d11c5eb81f19aab Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl at mellanox.com>
Date: Sat, 20 Jan 2018 11:26:31 +0800
Subject: [PATCH] cmdline: avoid garbage in unused fields of parsed result

[ upstream commit 0bf876008f4e51d8c006a3adb3866f0c35c33fbb ]

The result buffer was not initialized before parsing, inducing garbage
in unused fields or padding of the parsed structure.

Initialize the result buffer each time before parsing.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Xueming Li <xuemingl at mellanox.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
 lib/librte_cmdline/cmdline_parse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_cmdline/cmdline_parse.c b/lib/librte_cmdline/cmdline_parse.c
index c74b146..7f799f9 100644
--- a/lib/librte_cmdline/cmdline_parse.c
+++ b/lib/librte_cmdline/cmdline_parse.c
@@ -168,6 +168,8 @@ match_inst(cmdline_parse_inst_t *inst, const char *buf,
 	int n = 0;
 	struct cmdline_token_hdr token_hdr;
 
+	if (resbuf != NULL)
+		memset(resbuf, 0, resbuf_size);
 	/* check if we match all tokens of inst */
 	while (!nb_match_token || i < nb_match_token) {
 		token_p = get_token(inst, i);
-- 
2.7.4



More information about the stable mailing list