summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-04-10 10:49:01 +0200
committerAndreas Schneider <asn@samba.org>2014-04-14 15:29:10 +0200
commit4ed4524c5851bbb042caa052f66263b734cf5546 (patch)
tree76bdb8754427781d7154c66a2cfbbdca3f055881 /tests
parentfab60bb3f61c7dfd1f028a1f9821dab9ad826df7 (diff)
downloadsocket_wrapper-4ed4524c5851bbb042caa052f66263b734cf5546.tar.gz
socket_wrapper-4ed4524c5851bbb042caa052f66263b734cf5546.tar.xz
socket_wrapper-4ed4524c5851bbb042caa052f66263b734cf5546.zip
tests: Fix an out of bound access.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_echo_tcp_writev_readv.c6
1 files changed, 4 insertions, 2 deletions
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]);