From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 79073A05D3 for ; Mon, 20 May 2019 16:06:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E28BE5B38; Mon, 20 May 2019 16:05:59 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 18BF33DC; Mon, 20 May 2019 16:05:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 May 2019 07:05:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,491,1549958400"; d="scan'208";a="173628979" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 20 May 2019 07:05:56 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.10]) by IRSMSX103.ger.corp.intel.com ([169.254.3.133]) with mapi id 14.03.0415.000; Mon, 20 May 2019 15:05:55 +0100 From: "Trahe, Fiona" To: "Jozwiak, TomaszX" , "dev@dpdk.org" , "shallyv@marvell.com" , "stable@dpdk.org" CC: "Trahe, Fiona" , "Trybula, ArturX" Thread-Topic: [PATCH] app/test-compress-perf: fix reliance on integer endianness Thread-Index: AQHVDw+ZuSq8OP7YP0KZfUroOQpx+KZ0CtYQ Date: Mon, 20 May 2019 14:05:54 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B4358976C60C@IRSMSX101.ger.corp.intel.com> References: <1558358764-32053-1-git-send-email-tomaszx.jozwiak@intel.com> <1558358764-32053-2-git-send-email-tomaszx.jozwiak@intel.com> In-Reply-To: <1558358764-32053-2-git-send-email-tomaszx.jozwiak@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDFkZmFjN2ItZGVkYi00YmIzLTlhM2EtNjZhYTUzOGZlZDhmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiamx1M2h1MUhVemdHbTFlVVwvamFkZ0lRVWNuc0huV040NDFhemlLdVpMTEZPYXNZOURNZnZCSDFVRWN6SXBTbU0ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/test-compress-perf: fix reliance on integer endianness 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" HI Tomasz, > -----Original Message----- > From: Jozwiak, TomaszX > Sent: Monday, May 20, 2019 2:26 PM > To: dev@dpdk.org; Trahe, Fiona ; Jozwiak, TomaszX > ; shallyv@marvell.com; stable@dpdk.org > Subject: [PATCH] app/test-compress-perf: fix reliance on integer endianne= ss >=20 > This patch fixes coverity issue: > Reliance on integer endianness (INCOMPATIBLE_CAST) > in parse_window_sz function. >=20 > Coverity issue: 328524 > Fixes: e0b6287c035d ("app/compress-perf: add parser") > Cc: stable@dpdk.org >=20 > Signed-off-by: Tomasz Jozwiak > --- > app/test-compress-perf/comp_perf_options_parse.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-= compress- > perf/comp_perf_options_parse.c > index 2fb6fb4..56ca580 100644 > --- a/app/test-compress-perf/comp_perf_options_parse.c > +++ b/app/test-compress-perf/comp_perf_options_parse.c > @@ -364,13 +364,15 @@ parse_max_num_sgl_segs(struct comp_test_data *test_= data, const char *arg) > static int > parse_window_sz(struct comp_test_data *test_data, const char *arg) > { > - int ret =3D parse_uint16_t((uint16_t *)&test_data->window_sz, arg); > + uint16_t tmp; > + int ret =3D parse_uint16_t(&tmp, arg); >=20 > if (ret) { > RTE_LOG(ERR, USER1, "Failed to parse window size\n"); > return -1; > } >=20 > + test_data->window_sz =3D (int)tmp; > return 0; > } [Fiona] I expect this fixes this coverity issue - but will it result in ano= ther one? window_sz on the xform is uint8_t - so this int will get truncated later, a= nd there's no cast done at that point. Would it be better to add a new parse_uint8_t fn and change test-data->wind= ow_sz to a unit8_t? Or add that cast?