From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0087.outbound.protection.outlook.com [104.47.34.87]) by dpdk.org (Postfix) with ESMTP id 365CC1B220; Wed, 16 May 2018 08:40:17 +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=GgbyA7T4PSkGffnhb14ldfJ7mBx/19WqvJmCe4fK45U=; b=lDd0IRK7eu8PwTdMcgE71+gSQ/BNKJrvGrF5ZCqFs0EJVHEIA26w4DB4a871VuN2c4kHA4UngslHR6wQOU0LSs49za52hvC9mFRp6jFA2FYrPGzS5pNZPHm2cf9hdtGW2SUQom/vjQDiPtrnGOSb1gSjkhPucVKlpd4tN3/Oeg4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.caveonetworks.com (122.178.202.31) by CY1PR07MB2524.namprd07.prod.outlook.com (2a01:111:e400:c636::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Wed, 16 May 2018 06:40:12 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, Jerin Jacob , declan.doherty@intel.com, andy@warmcat.com, stable@dpdk.org Date: Wed, 16 May 2018 12:09:54 +0530 Message-Id: <20180516063955.6193-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [122.178.202.31] X-ClientProxiedBy: CO2PR07CA0070.namprd07.prod.outlook.com (2603:10b6:100::38) To CY1PR07MB2524.namprd07.prod.outlook.com (2a01:111:e400:c636::15) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2524; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 3:/miJJpD4KjknlUFaS1QxKhNsfYCl0quwGQYa9Da0XIiHQWqsxCiAhnH9j9RQT9KL95ysAnpjbqY06Zfrp3wHQkR9XU3hCHYf/el6zpHvrECclBb0Rub3klLNqL071ZqdZPQFewqGF5a7tm9+Fd9iVBYKStfjoWGwJ+3sCJdUKezDw9RnxCkia+NZUfe5iFe7iRmPtGCFo0j9phPet5fFoBMZY5jICqeClNP4lEDCcH2tkqDWZhO6nwJMV41EYAO+; 25:zUOquvG0tWTLWZSlhYcbxvFWVsjhAhuXh/Vko/nZ+Rkk9GEe1ApHGVAL1R3Se354GXkYxjL336ZfwrScqslhZo46EZENOTReZPHB9idvSNHu8IsPeQHdDUa6wMDKMAKXZuDBdFI74NxrhWwftihc2Cqh/BYz6QSDro8S3srNGZSM08qlAz8rSXxAb9J9ITM5Xp8YUYczXR/ANQIcrHW1lwMS+UzCFq+SCIfeHkfQ9Uizvl98umYaQg6T9w0VTKk5bXE0agbiRFi5S+agxYTOoNs9e72wbjrqsTiTyfSHTt4O5+aTFDf528IC7NF49bTKSdbKcaGK6x2CI2GbrOghhA==; 31:QDtZkpIg6tqJUe30wK24Hx64kE1C8ACbICyxCZxCIkYM8F06BFMeNMXR1yyyILJYbUy3GabIJ9z/4AE3w1zYqeoqEnVqYhAZwycyjBNhnUMlRLW0XFKHv/mP+VpcBNSoOEXnZnfDgEavwlF73n12xaEc5WTF+F0eA979fjVqMoDIAYNlB6DXTJp7B/f9A5ZWZLHvu97KC7w8I4Jp9muuWbRHqgo3UxPK7Hs17gDlgwU= X-MS-TrafficTypeDiagnostic: CY1PR07MB2524: X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 20:mpB7/UhqGelHoxRKhzREBVSPtmpcnJp2C2Z6Ilf11Ov56ADG3Q7coRWodM+DAcuCSHV0NCuwLrpRh2fVjMDf7YblzcDM7zEoHOK+3hg5Wm784zVJR918Ss0Ib3ke/iT2nizh6RHLnvrje6XGS3LS9l5pQhnbtDYhATqYz3OW1n18EcYi10S+VhegrCuqGAAeomh09gjH8yczXvkxC0cOtW781XRDUFpp5/tHgqvx4BhKeiegavk61o2cY/5WkhrsHnnSWcmAaNVhOT7BruEg3DMXeA+7aqsdhewgVahCEhWQlol3RRqVS3ThdmzAuxOysUNaL0jWIOu3JkjH/JxQtbAeJDo8usxFetfiLambG0MRsBdNsbB5lRYdZkNThwNU3i9D6Hse1yjoOd+wRSBFT4U+RLBttCL21/gvmd7uid85SECnFPk1iSsE8HSL+XFqXJkfnni0CnK0eZr2PvU4uIPzSF8NXf+NzCyb/Uy9fqmG9y+LzcYt65Vq1Y8NqefF66LW4SD0lShrCSawVWFOJuTaO3vt1fWJX+sf8haSz/C0ydJ4KIU6Z0NYPSZn9Mck8rqwewSk037I0tteUvVvuSx5btJA4GRr9xfLKUsaEBM=; 4:BmfBRELfSt8cux93F3Iv++57uFl20XeYm4hPXcm1TalTLb0ExkL7m4Ki2M/pamy6hHMxB8VXwZLCSPWOZWN0+dZGY4cSdl/L1nfn+0mBu2iYOeIHkrCmMehdlFJJiCnqoc03w9/2O8W2JxPuTnk4jNgr5tIL+uYFFv9zJrdAOmt1meNHTPoUK9WZH1Q3HSsNBRbBK56BP/uvei2TB1XtLRyGn5tz8UmOb3Sw2HLllTAqRMy9qXKvRvXIPI083C32kKknDaXNUCrEUP0vQ0ByQD5A++ooXTOcXRklcgQrpACHrG8kVM51Bot7j8+GCyuW 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)(3231254)(944501410)(52105095)(93006095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR07MB2524; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2524; X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(396003)(39860400002)(39380400002)(376002)(189003)(199004)(106356001)(81166006)(16526019)(186003)(26005)(69596002)(81156014)(8676002)(476003)(6116002)(3846002)(1857600001)(486006)(2616005)(956004)(6506007)(386003)(25786009)(53416004)(8936002)(6512007)(50226002)(68736007)(50466002)(2906002)(478600001)(105586002)(44832011)(23676004)(316002)(2870700001)(52116002)(72206003)(5660300001)(53936002)(97736004)(7736002)(6486002)(6666003)(6916009)(66066001)(2361001)(36756003)(2351001)(305945005)(4326008)(1076002)(47776003)(42882007); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2524; H:jerin.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjA3TUIyNTI0OzIzOnoxamxiZFNsQWZFWS9EZFdjTHYvSm5WQjdJ?= =?utf-8?B?dTluaGRGeERXeGZtTGRUY2dJQjI2TThpWW05aFIzL1JNSHF6V2RJZEFYbEdh?= =?utf-8?B?UDd2dHNMNTlGdlA5Y3JqQlFuZHIxeTNYYnVxTEd5M3NNcHV4c0pWSGgxSGtX?= =?utf-8?B?L0x4eWJ1cyszOXdsNWJObit3cldDSkhPemVyZ2ZOWkhPVGFBVndWbWxGc0Uw?= =?utf-8?B?VWlETlI5Ty9nUGlFTVh6RkducHdUNHFSWUdUN0tNZk5CKzlFMnNFT2hOSmxT?= =?utf-8?B?V2hqdjF5NUY2ZXVzbHlzU2lmWjdqcXlQN3FpRU1ZbG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1USa6p7ZYM97EH0ZuFDgLCUS9cP0r7Q8KQtIuSxgr7NzsSoGag601fC3d+irbZFG6JPVMbOL4Eut6PK/wRplZvX+KtbjH7lUgvlTiBC+3Dmx3KwcBPHEtEUATWM5cys9gSa/FCwDUdjYyxLkwMQDpvNvDWhtDMUZMxVKkbnbj3SEOasdinCzFXQiHpIOKLOe1OsyLp9RzuFNsTCMCU2uBfnmK0ddAfTisiT9O4A26wZWj/BxjLVA==; 5:+Og068ICXu4gqYIjrPgLb+Xj4fhyPdhkHH91cEvnAePZZCy/w1N+tbUJYoO+IvX9pgmaGcEuhIVpaH4L9jICuqlz5T2rDXKz1xEy/tbvfq7mdc6b/OGtPSID0T/+q0i6o43rbfQ9o+v/dzfRCGZM/sykPzOQ4QmB77lc2a0pf6g=; 24:UjX+wDgXmes8Q4GmfSYzFxSMozUmxOy/7gKhr+hv/Tp/2uakh9fd2XDejMiti+c/QrW8yuG8fDtqb6S1JfkTHkP8aZv5bizBR60VPxXNIM4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 7:oz2G/9Vt0+3DS2u3NwrMzKevLaMeONcftEl6Nq3Hcvn1MsRIjnd/4WAL3gk/81U+nB44yStvqd3ieQbKcZ5wuymY1MDDMnhnvlQePIcHTMshJB0GQM2pyvtekwDtPbW/jbEvYlSobH9tMCZM7J7nAo4uPb5WQrgWWXO7mQDmCXAMFqyggTVTdRnUIAA7t+sdNesyl5G6dTYO6tmZJZrh/cQH92MmciyXT1ecRjLqeH9HUnUUQK6nd1ZYT1mg5iGt X-MS-Office365-Filtering-Correlation-Id: 2181074f-e66e-488e-a462-08d5baf7e1ef X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2018 06:40:12.8529 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2181074f-e66e-488e-a462-08d5baf7e1ef X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2524 Subject: [dpdk-dev] [PATCH 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 06:40:17 -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 --- 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