From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 6E5E57CD8 for ; Wed, 15 Nov 2017 16:54:06 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 15 Nov 2017 17:54:05 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id vAFFs483027666; Wed, 15 Nov 2017 17:54:05 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id vAFFs4ZL010013; Wed, 15 Nov 2017 23:54:04 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id vAFFs4M8010012; Wed, 15 Nov 2017 23:54:04 +0800 From: Xueming Li To: Olivier Matz Cc: Xueming Li , dev@dpdk.org Date: Wed, 15 Nov 2017 23:54:02 +0800 Message-Id: <20171115155402.9967-1-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 Subject: [dpdk-dev] [PATCH] lib/cmdline: init parse result memeory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2017 15:54:06 -0000 Initialize binary result memory before parsing to avoid garbage in parsing result. Signed-off-by: Xueming Li --- 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 3e12ee54f..9124758f1 100644 --- a/lib/librte_cmdline/cmdline_parse.c +++ b/lib/librte_cmdline/cmdline_parse.c @@ -267,6 +267,8 @@ cmdline_parse(struct cmdline *cl, const char * buf) if (!cl || !buf) return CMDLINE_PARSE_BAD_ARGS; + memset(tmp_result.buf, 0, sizeof(tmp_result.buf)); + ctx = cl->ctx; /* -- 2.13.3