From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 40DAB2934 for ; Thu, 3 Nov 2016 13:12:46 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 03 Nov 2016 05:12:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,438,1473145200"; d="scan'208";a="781911583" Received: from sie-lab-212-071.ir.intel.com (HELO silpixa00381633.ir.intel.com) ([10.237.212.71]) by FMSMGA003.fm.intel.com with ESMTP; 03 Nov 2016 05:12:44 -0700 From: Fan Zhang To: dev@dpdk.org Date: Thu, 3 Nov 2016 12:12:40 +0000 Message-Id: <1478175163-229116-1-git-send-email-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix buffer not null terminated X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2016 12:12:46 -0000 Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file") Coverity issue: 137854 Signed-off-by: Fan Zhang --- examples/ipsec-secgw/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c index 99bdfc5..e09a7c0 100644 --- a/examples/ipsec-secgw/parser.c +++ b/examples/ipsec-secgw/parser.c @@ -248,7 +248,7 @@ parse_ipv4_addr(const char *token, struct in_addr *ipv4, uint32_t *mask) if (mask) *mask = atoi(pch); } else { - strncpy(ip_str, token, sizeof(ip_str)); + strncpy(ip_str, token, sizeof(ip_str) - 1); if (mask) *mask = 0; } -- 2.5.5