From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 09 Jun 2016 04:17:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,444,1459839600"; d="scan'208";a="972162560" Received: from unknown (HELO Sent) ([10.103.102.192]) by orsmga001.jf.intel.com with SMTP; 09 Jun 2016 04:14:59 -0700 Received: by Sent (sSMTP sendmail emulation); Thu, 09 Jun 2016 13:14:58 +0200 From: Tomasz Kulasek To: declan.doherty@intel.com, arkadiuszx.kusztal@intel.com Cc: dev@dpdk.org Date: Thu, 9 Jun 2016 13:14:32 +0200 Message-Id: <1465470872-2652-1-git-send-email-tomaszx.kulasek@intel.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] app/test: fix array overflow warning with gcc 4.5 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 11:25:55 -0000 DPDK/app/test/test_cryptodev.c: In function ‘create_snow3g_cipher_operation _oop.clone.15’: DPDK/x86_64-native-linuxapp-gcc/include/rte_memcpy.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_memcpy code for length bigger than 255, causing the problem. The root of this issue and solution is the same as for commit 2c007ea10616 ("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, const unsigned iv_len, } 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_len, const unsigned cipher_len, const unsigned cipher_offset) { -- 1.7.9.5