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 C7F072934 for ; Thu, 3 Nov 2016 13:12:47 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 03 Nov 2016 05:12:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,438,1473145200"; d="scan'208";a="781911604" 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:46 -0700 From: Fan Zhang To: dev@dpdk.org Date: Thu, 3 Nov 2016 12:12:42 +0000 Message-Id: <1478175163-229116-3-git-send-email-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1478175163-229116-1-git-send-email-roy.fan.zhang@intel.com> References: <1478175163-229116-1-git-send-email-roy.fan.zhang@intel.com> Subject: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix copy into fixed size buffer issue 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:48 -0000 Coverity issue: 137875 Fixes: 0d547ed0 ("examples/ipsec-secgw: support configuration file") Signed-off-by: Fan Zhang --- examples/ipsec-secgw/sa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 9e2c8a9..c891be2 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -177,7 +177,7 @@ parse_key_string(const char *key_str, uint8_t *key) pt_end = strchr(pt_start, ':'); if (pt_end == NULL) - strncpy(sub_str, pt_start, strlen(pt_start)); + strncpy(sub_str, pt_start, strlen(sub_str) - 1); else { if (pt_end - pt_start > 2) return 0; -- 2.5.5