diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index 7c03a06785..aa533483fd 100644 --- a/app/test/test_ipsec.c +++ b/app/test/test_ipsec.c @@ -629,7 +629,8 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string, rte_memcpy(dst, string, len); dst += len; /* copy pad bytes */ - rte_memcpy(dst, esp_pad_bytes, padlen); + rte_memcpy(dst, esp_pad_bytes, RTE_MIN(padlen, + sizeof(esp_pad_bytes))); dst += padlen; /* copy ESP tail header */ rte_memcpy(dst, &espt, sizeof(espt));