From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Kulasek Subject: [PATCH] app/test: fix array overflow warning with gcc 4.5 Date: Thu, 9 Jun 2016 13:14:32 +0200 Message-ID: <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 To: declan.doherty@intel.com, arkadiuszx.kusztal@intel.com Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id DA14F2B85 for ; Thu, 9 Jun 2016 13:25:54 +0200 (CEST) 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" DPDK/app/test/test_cryptodev.c: In function =E2=80=98create_snow3g_cipher= _operation _oop.clone.15=E2=80=99: DPDK/x86_64-native-linuxapp-gcc/include/rte_memcp= y.h:796:14 error: array subscript is above array bounds. In test_cryptodev.c: 2429 rte_memcpy(sym_op->cipher.iv.data, iv, iv_len); 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, it causes 'above array bounds' warning in gcc 4.5 and breaks compilation. Using uint8_t as a size of copied block prevents to evaluate in rte_memcp= y code for length bigger than 255, causing the problem. The root of this issue and solution is the same as for commit 2c007ea1061= 6 ("app/test: fix array overflow warning with gcc 4.5") Fixes: 9727af14b032 ("app/test: add out-of-place symmetric crypto operations") Signed-off-by: Tomasz Kulasek --- app/test/test_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 45e6daa..6621573 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -2392,7 +2392,7 @@ create_snow3g_cipher_operation(const uint8_t *iv, c= onst unsigned iv_len, } =20 static int -create_snow3g_cipher_operation_oop(const uint8_t *iv, const unsigned iv_= len, +create_snow3g_cipher_operation_oop(const uint8_t *iv, const uint8_t iv_l= en, const unsigned cipher_len, const unsigned cipher_offset) { --=20 1.7.9.5