From 4ed4524c5851bbb042caa052f66263b734cf5546 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 10 Apr 2014 10:49:01 +0200 Subject: tests: Fix an out of bound access. Signed-off-by: Andreas Schneider Reviewed-by: Jakub Hrozek Reviewed-by: Simo Sorce --- tests/test_echo_tcp_writev_readv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_echo_tcp_writev_readv.c b/tests/test_echo_tcp_writev_readv.c index 9f6703f..c7b8dd9 100644 --- a/tests/test_echo_tcp_writev_readv.c +++ b/tests/test_echo_tcp_writev_readv.c @@ -68,7 +68,8 @@ static void test_writev_readv_ipv4(void **state) for (j = 0; j < i; j++) { memset(send_buf[j], 0, 64); - snprintf(send_buf[j], sizeof(send_buf), "packet.%d", j); + snprintf(send_buf[j], sizeof(send_buf[j]), + "packet.%d", j); iov_send[j].iov_base = send_buf[j]; iov_send[j].iov_len = strlen(send_buf[j]); @@ -132,7 +133,8 @@ static void test_writev_readv_ipv6(void **state) for (j = 0; j < i; j++) { memset(send_buf[j], 0, 64); - snprintf(send_buf[j], sizeof(send_buf), "packet.%d", j); + snprintf(send_buf[j], sizeof(send_buf[j]), + "packet.%d", j); iov_send[j].iov_base = send_buf[j]; iov_send[j].iov_len = strlen(send_buf[j]); -- cgit