From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] app/test: fix array overflow warning with gcc 4.5 Date: Mon, 13 Jun 2016 22:04:18 +0200 Message-ID: <4121599.adsh2vQa8a@xps13> References: <1465470872-2652-1-git-send-email-tomaszx.kulasek@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, declan.doherty@intel.com, arkadiuszx.kusztal@intel.com To: Tomasz Kulasek Return-path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 669295A35 for ; Mon, 13 Jun 2016 22:04:20 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id v199so92965987wmv.0 for ; Mon, 13 Jun 2016 13:04:20 -0700 (PDT) In-Reply-To: <1465470872-2652-1-git-send-email-tomaszx.kulasek@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-06-09 13:14, Tomasz Kulasek: > DPDK/app/test/test_cryptodev.c: In function =E2=80=98create_snow3g_ci= pher_operation > _oop.clone.15=E2=80=99: DPDK/x86_64-native-linuxapp-gcc/include/rte_m= emcpy.h:796:14 > error: array subscript is above array bounds. >=20 > In test_cryptodev.c: > 2429=09rte_memcpy(sym_op->cipher.iv.data, iv, iv_len); >=20 > When iv_len is declared as 'unsigned int', rte_memcpy evaluates code = for > buffer size bigger than 255, but while 'iv' array is 64 bytes long, i= t > causes 'above array bounds' warning in gcc 4.5 and breaks compilation= . >=20 > Using uint8_t as a size of copied block prevents to evaluate in rte_m= emcpy > code for length bigger than 255, causing the problem. >=20 > The root of this issue and solution is the same as for commit 2c007ea= 10616 > ("app/test: fix array overflow warning with gcc 4.5") >=20 > Fixes: 9727af14b032 ("app/test: add out-of-place symmetric crypto > operations") >=20 > Signed-off-by: Tomasz Kulasek Applied, thanks