Marcus Meissner : kernel32: Fixed read overflow in WriteFile argument.
Alexandre Julliard
julliard at winehq.org
Wed Jun 20 13:49:45 CDT 2012
Module: wine
Branch: master
Commit: b652dcee420be13b1b70c831981bc1c2fad10817
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b652dcee420be13b1b70c831981bc1c2fad10817
Author: Marcus Meissner <marcus at jet.franken.de>
Date: Wed Jun 20 20:10:12 2012 +0200
kernel32: Fixed read overflow in WriteFile argument.
---
dlls/kernel32/tests/pipe.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index bd196fe..923c0e7 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -1758,7 +1758,7 @@ static void test_readfileex_pending(void)
OVERLAPPED overlapped;
char read_buf[1024];
char write_buf[1024];
- const char *test_string = "test";
+ const char test_string[] = "test";
int i;
server = CreateNamedPipe(PIPENAME, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_DUPLEX,
@@ -1798,9 +1798,9 @@ static void test_readfileex_pending(void)
ok(ret == TRUE, "ReadFileEx failed, err=%i\n", GetLastError());
ok(completion_called == 0, "completion routine called before ReadFileEx returned\n");
- ret = WriteFile(client, test_string, sizeof(test_string), &num_bytes, NULL);
+ ret = WriteFile(client, test_string, strlen(test_string), &num_bytes, NULL);
ok(ret == TRUE, "WriteFile failed\n");
- ok(num_bytes == sizeof(test_string), "only %i bytes written\n", num_bytes);
+ ok(num_bytes == strlen(test_string), "only %i bytes written\n", num_bytes);
ok(completion_called == 0, "completion routine called during WriteFile\n");
@@ -1809,9 +1809,9 @@ static void test_readfileex_pending(void)
ok(completion_called == 1, "completion not called after writing pipe\n");
ok(completion_errorcode == 0, "completion called with error %x\n", completion_errorcode);
- ok(completion_num_bytes == sizeof(test_string), "ReadFileEx returned only %d bytes\n", completion_num_bytes);
+ ok(completion_num_bytes == strlen(test_string), "ReadFileEx returned only %d bytes\n", completion_num_bytes);
ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
- ok(!memcmp(test_string, read_buf, sizeof(test_string)), "ReadFileEx read wrong bytes\n");
+ ok(!memcmp(test_string, read_buf, strlen(test_string)), "ReadFileEx read wrong bytes\n");
/* Make writes until the pipe is full and the write fails */
memset(write_buf, 0xaa, sizeof(write_buf));
More information about the wine-cvs
mailing list