summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2017-06-28 10:31:03 +0100
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2017-06-28 20:08:38 +0200
commit405268c73de200733afe7eaa60d003be1f86e855 (patch)
tree15c049e7e26829ffb0fbc5000179f720ef5a9176 /test
parentfe09afb73b349bdb25b343a09810ba1bfe6e5bcf (diff)
downloaddpdk-405268c73de200733afe7eaa60d003be1f86e855.zip
dpdk-405268c73de200733afe7eaa60d003be1f86e855.tar.gz
dpdk-405268c73de200733afe7eaa60d003be1f86e855.tar.xz
test/crypto: fix overflow
In one of the SNOW3G unit tests, insufficient memory was allocated, leading to a buffer overflow. Fixes: 2b52e1e95aab ("app/test: add SNOW 3G UEA2 with offset") Cc: stable@dpdk.org Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Diffstat (limited to 'test')
-rw-r--r--test/test/test_cryptodev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index eed7385..f8f15c0 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -3580,8 +3580,7 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata)
rte_hexdump(stdout, "ciphertext:", ciphertext, plaintext_len);
#endif
- expected_ciphertext_shifted = rte_malloc(NULL,
- ceil_byte_length(plaintext_len + extra_offset), 0);
+ expected_ciphertext_shifted = rte_malloc(NULL, plaintext_len, 8);
TEST_ASSERT_NOT_NULL(expected_ciphertext_shifted,
"failed to reserve memory for ciphertext shifted\n");