From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 412C0728E for ; Thu, 1 Feb 2018 10:48:12 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E72CB202F7; Thu, 1 Feb 2018 04:48:11 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 01 Feb 2018 04:48:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=CRlJLlRdo8e6AgqOo IxuqztsqxXHkXPaQPwCbo6xkTU=; b=eRKuYgNqKbAmojfVWUhPzIDU3UqC9hvy6 8YYlq6UPPcegN6+oUnnmDrN1OHuy2gOcKvqszd8PnqgLaLpy0eR0J4MipwptGIJL HpITbr6dZPrLMdUA5jwipwXx1xFkdXGfzJE5/Oq8tlG2i+3awS470O0odC6uZFq4 d5SNOpBnSB9CQMNKny+z4BfGvTDnxtz1DsePW8vNQEaRlEyaVCe7AvUnTgEUNbiS pNzbPB/AB1Z6vmz63UrP8IGn8/WZAF6AiEpDAN7bQ86LtxuFA11gh+Tb0WbFbgeX rtedYgtx12wzToXKbOf1khhF8OdQOs478FsO6Ra3Sfl2CqrqJRLWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=CRlJLlRdo8e6AgqOoIxuqztsqxXHkXPaQPwCbo6xkTU=; b=kCLroGE8 /w6HUhryMEoA2XP+Unosoch0QlMUZGzq5sExePfEBsN0++JG/U2ui8VGx4j6cnS+ TulafD7jk/UcA9Nbi8v9DmyMYOUg7Bt93mvL6DcBuo0eVu+HS+s06mspsNRv724A DrhTLIRIHK4aYLWu1whSMG+dGsiKrtZ++4SaOLxnX15V3c1hyi8T4M7IZjZAWuJI eqEPeMd3Qa7l0UZNZJyyACns8kQij9X7gjlRWlEXMqSzGeao+3NPk6BfvJwzfVyd y0ujZyo++qCH40v/e9LGeKe6j0upIqTsPbpAJyLzTJ5WzQEk/CmhwU7emc6o79zN JifaRJFAhLn02w== X-ME-Sender: Received: from yliu-mob.mtl.com (unknown [115.150.27.200]) by mail.messagingengine.com (Postfix) with ESMTPA id 1B583240B6; Thu, 1 Feb 2018 04:48:09 -0500 (EST) From: Yuanhan Liu To: Xueming Li Cc: Olivier Matz , dpdk stable Date: Thu, 1 Feb 2018 17:47:18 +0800 Message-Id: <1517478479-12417-4-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> References: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'cmdline: avoid garbage in unused fields of parsed result' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 09:48:12 -0000 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 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 Acked-by: Olivier Matz --- 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