From: Tomasz Kulasek Date: Thu, 9 Jun 2016 11:14:32 +0000 (+0200) Subject: app/test: fix array overflow warning with gcc 4.5 X-Git-Tag: spdx-start~6766 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=393c891ff1ad1484a4f2cb8267636ead2c0de2c8;p=dpdk.git app/test: fix array overflow warning with gcc 4.5 app/test/test_cryptodev.c: In function ‘create_snow3g_cipher_operation_oop.clone.15’: 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 --- diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 45e6daa10a..662157329b 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) {