From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0072.outbound.protection.outlook.com [104.47.37.72]) by dpdk.org (Postfix) with ESMTP id D5FBDD11D; Wed, 16 May 2018 14:28:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zoHwPZ87ROjOsoSf3xOnTRUhZUW6Nahc4lYriW21GYs=; b=SyhmrsCbGt+6KS7q6czY1r6o3RKMgKOn4+OZmf+9ClO84DvPuOuz91ufn3qpfmn03yavsMbEQ5C9TNa47OpKBGaGYq/HqYAzK2w3DsaGiU/M7HhXORjDmuUt46s9QgXUoosc0xL/ejX/j+aVpMaYZ8m7DsdR+62uWLtmJ1I3BN0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.caveonetworks.com (122.178.241.249) by BN3PR07MB2513.namprd07.prod.outlook.com (2a01:111:e400:7bbf::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.11; Wed, 16 May 2018 12:28:21 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, thomas@monjalon.net, Jerin Jacob , declan.doherty@intel.com, andy@warmcat.com, stable@dpdk.org Date: Wed, 16 May 2018 17:58:03 +0530 Message-Id: <20180516122804.535-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516063955.6193-1-jerin.jacob@caviumnetworks.com> References: <20180516063955.6193-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [122.178.241.249] X-ClientProxiedBy: CO2PR07CA0072.namprd07.prod.outlook.com (2603:10b6:100::40) To BN3PR07MB2513.namprd07.prod.outlook.com (2a01:111:e400:7bbf::10) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN3PR07MB2513; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2513; 3:0KugVQ6DezC+6cjNZqS0kPO1YBQPdSIaoJruUUt1/ecvm736RhodRh1XAajDXZaz7f4aDm90oZSKF1PAWcTr6hBPtdTsmLJ19Cky5AfIHfV2Li1KXuk8hEO47TuLQeFlsHtenBQ9aEvH15y0hNmfl21SHKjp4xjQw9hyNUfFrvzagg7U5M8ffQl/kVJbuATkWfzp1hxmbBVrbAa90KamkaNOg0tvRKUvwrA5gRmWjQpaIHATs98t97ArH5S4j6Q/; 25:ZykmfliLYLb9GgQRRWgDLXFyF+DgxARQMvaHFyXTwZhqVNZPxaO5NIkdrJ0HBnnENJoV3d21SuJVHQBXM3os81g6oigtBz14zVH9AnUOjhqSGW9IbD32jI/ClwgKIycmdfd74j0OG3hsFAWLJuXVtC7soq2Gu/biavptRO1HoQTkXqFLry82vcKFyWIiterliLv83grLXA9ttuLuf8XeWfiYyGMNaDzMOYcrsIGYooR3hJja3eGw+9UsrtZdVv6o844o4IMXumEsI4InTjN1o7ec5q+UcTl9r6okxLGnmCdosnw5MR0o7KBsbJ6Shz8/lw1TyIyN10L7v3ZzcyZ2yQ==; 31:hGg5/WpoRQnF+mVLyI6Dz/oOZgXBEOR9GGY9E+rMY3D81cp3S8hPmQqTuqqeNaQyoYKmt9/7FTSpZNr/OO+RE4aSYUGMV3ctG5b5zmmK+iN3LkrhEQL5ET7WPNZx4X9qfR6LQPYtW2SsPiGS6wABctbQxD0SrGV9hv8ooRuXZT05PpE6mDqZNok2cxWD4kf28vAAyQUxZsh7clBmMo000FqTSxE2Ev9JUjoAxdtlldk= X-MS-TrafficTypeDiagnostic: BN3PR07MB2513: X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2513; 20:YVjUDDQKUOaLUaK0+v1m+5hk9vZOXG+znZhUvefAzNOIfO4QUoa9RiWDPlvNnxHwcUbHMDurQ183FnZmROIA5ZdzAO48CJanXuVe5LplQec/gEmaERkLneQqGBCr51AI0yMeFDoP5cRwU/SPCr2PNXbPuZlru2/Y9IPWwdP6jiLa1Qhac2vG77OB5N68Aj1SuG8f9wGT9O8jruuRr47uoJhWqDVvtLJkFQ3zCTUCjcSMQ8a4vUM/slXXiBjXADC5AH2fr8pwvu94kKLqEU8iLw5PpXU9BgC+ypN0SXMjCdsA4jB81ixwvZm+S5M509Via5+jyKpNvTZo42x9h8imZrT3Q8ch7EiOC0YLe25lra7U8oBLvrFKcNZ4NP3GuPKIdO2ZKaNw49W3hy2upeQCowc/V6t86C3Ng8hU2NppBFg3qPCMxz8qMieKm4WfIfhZVpn+iIWXx+nBnsv0aLCiDf/8Nz5N7aGBDeV/ytzO4XD8pjTtXHqc+VyXC/ZAo6uacnbUon/o51fA0ynilIUTlJ9L4hZzE6UuUL4YaD9HDtsf5zB09QrHwpaUqNnExVG+mAZjz//TAoKHM8LXPPqHE6QvcBW6WTkyMAP2gtSEPa0=; 4:HzFnucm7yPsNtPqjyCaicdwrpWMCKkLY8fxIlxNEg4hNBK05ACUyT/2HHTWkoXRUF4h3drZU0A9rZU6bNmrljbLIY85fwxKxPpK2nEx+GnO/W9qbwdjEFtcRHCo+fQY7zGIJ2xTv3JfpDNJfe//t9ISqias66F4arAcBWJI+324rZlgTXEreEUVoqBffIGnjS8sX1fIUavplaTMszaiiJc8LP78261qepupWQwQZSHuNKeGn3bEXbCM5dXPjqRnN1NfpqI8eJZeZi+N9pMEnnHKKuKiDifRme4DPwSiP98X/995yDs7l2ospmORzaJT1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:BN3PR07MB2513; BCL:0; PCL:0; RULEID:; SRVR:BN3PR07MB2513; X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(366004)(39860400002)(39380400002)(396003)(199004)(189003)(69596002)(186003)(2351001)(68736007)(2361001)(6116002)(3846002)(386003)(25786009)(47776003)(26005)(36756003)(6506007)(76176011)(16526019)(1857600001)(66066001)(1076002)(23676004)(52116002)(81156014)(6916009)(316002)(6666003)(305945005)(7736002)(8936002)(81166006)(50226002)(8676002)(446003)(44832011)(486006)(5660300001)(42882007)(53416004)(97736004)(956004)(2616005)(11346002)(105586002)(476003)(106356001)(6486002)(4326008)(6512007)(2906002)(478600001)(2870700001)(72206003)(53936002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2513; H:jerin.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjA3TUIyNTEzOzIzOllCSksyRVB2ZStmVlpaUWZBOUZqMllhODRo?= =?utf-8?B?Ky9WZUlrM0hUdWlTRG10dk41TnNFRk5HbWhVSDhaMVBSa0NxekNBWTUrZWxu?= =?utf-8?B?Tzd2OS9HVW9jK2MwbU5TOUlWTEJBcWUxSzlOa29aY1JVOWt4TS9vSWhLQUl0?= =?utf-8?B?azdKQnNoWGVlMjY3MnFvVDduZkdORXF5YnYzVVYwVWFqS0pxSjlONXY2dGc4?= =?utf-8?B?WndvWDE3Nzl6M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CsbXTW86ehA6fV2UEYCzTtR X-MS-Office365-Filtering-Correlation-Id: 4f582a9e-9496-41d2-cb1e-08d5bb288504 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2018 12:28:21.2249 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f582a9e-9496-41d2-cb1e-08d5bb288504 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2513 Subject: [dpdk-dev] [PATCH v2 1/2] app/crypto-perf: use strcpy for allocated string 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, 16 May 2018 12:28:28 -0000 inlined from ‘cperf_test_vector_get_from_file’ at ../app/test-crypto-perf/cperf_test_vector_parsing.c:578:11: ../app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(entry, line, strlen(line)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error: ‘strncat’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncat(entry, line, strlen(line)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found this issue with meson build and gcc 8.1. Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Cc: declan.doherty@intel.com Cc: andy@warmcat.com Cc: stable@dpdk.org Signed-off-by: Jerin Jacob Acked-by: Pablo de Lara --- v2: - No change --- app/test-crypto-perf/cperf_test_vector_parsing.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c index 26321d004..92932a230 100644 --- a/app/test-crypto-perf/cperf_test_vector_parsing.c +++ b/app/test-crypto-perf/cperf_test_vector_parsing.c @@ -506,8 +506,7 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts) if (entry == NULL) return -1; - memset(entry, 0, strlen(line) + 1); - strncpy(entry, line, strlen(line)); + strcpy(entry, line); /* check if entry ends with , or = */ if (entry[strlen(entry) - 1] == ',' @@ -524,8 +523,8 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts) if (entry_extended == NULL) goto err; entry = entry_extended; - - strncat(entry, line, strlen(line)); + /* entry has been allocated accordingly */ + strcpy(&entry[strlen(entry)], line); if (entry[strlen(entry) - 1] != ',') break; -- 2.17.0