Re: [PATCH] ws2_32/tests: Fix memcmp size in test_TransmitFile().
On Fri, Jan 20, 2017 at 5:54 PM, Zebediah Figura <z.figura12(a)gmail.com> wrote:
Fixes https://bugs.winehq.org/show_bug.cgi?id=42221
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- dlls/ws2_32/tests/sock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 5856718..3c3e443 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -8304,9 +8304,9 @@ static void test_TransmitFile(void) iret = recv(dest, buf, sizeof(buf), 0); ok(iret == sizeof(header_msg)+sizeof(footer_msg)+2, "Returned an unexpected buffer from TransmitFile: %d\n", iret ); - ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)+1) == 0, + ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)) == 0, "TransmitFile header buffer did not match!\n"); - ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)+1) == 0, + ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)) == 0, "TransmitFile footer buffer did not match!\n");
Hi, you also have to change the sending lengths because it is also using +1. I believe this was a strlen/sizeof misfortune, right? Best wishes, Bruno
On 01/22/2017 11:34 AM, Bruno Jesus wrote:
On Fri, Jan 20, 2017 at 5:54 PM, Zebediah Figura <z.figura12(a)gmail.com> wrote:
Fixes https://bugs.winehq.org/show_bug.cgi?id=42221
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- dlls/ws2_32/tests/sock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 5856718..3c3e443 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -8304,9 +8304,9 @@ static void test_TransmitFile(void) iret = recv(dest, buf, sizeof(buf), 0); ok(iret == sizeof(header_msg)+sizeof(footer_msg)+2, "Returned an unexpected buffer from TransmitFile: %d\n", iret ); - ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)+1) == 0, + ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)) == 0, "TransmitFile header buffer did not match!\n"); - ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)+1) == 0, + ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)) == 0, "TransmitFile footer buffer did not match!\n");
Hi, you also have to change the sending lengths because it is also using +1. I believe this was a strlen/sizeof misfortune, right?
Best wishes, Bruno
Whoops, thanks for the pointer. (And I can only assume so; the code isn't mine.) --Zeb
On 01/22/2017 11:34 AM, Bruno Jesus wrote:
On Fri, Jan 20, 2017 at 5:54 PM, Zebediah Figura <z.figura12(a)gmail.com> wrote:
Fixes https://bugs.winehq.org/show_bug.cgi?id=42221
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- dlls/ws2_32/tests/sock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 5856718..3c3e443 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -8304,9 +8304,9 @@ static void test_TransmitFile(void) iret = recv(dest, buf, sizeof(buf), 0); ok(iret == sizeof(header_msg)+sizeof(footer_msg)+2, "Returned an unexpected buffer from TransmitFile: %d\n", iret ); - ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)+1) == 0, + ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)) == 0, "TransmitFile header buffer did not match!\n"); - ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)+1) == 0, + ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)) == 0, "TransmitFile footer buffer did not match!\n");
Hi, you also have to change the sending lengths because it is also using +1. I believe this was a strlen/sizeof misfortune, right?
Best wishes, Bruno
Whoops, thanks for the pointer. (And I can only assume so; the code isn't mine.) --Zeb
On 01/22/2017 11:34 AM, Bruno Jesus wrote:
On Fri, Jan 20, 2017 at 5:54 PM, Zebediah Figura <z.figura12(a)gmail.com> wrote:
Fixes https://bugs.winehq.org/show_bug.cgi?id=42221
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- dlls/ws2_32/tests/sock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 5856718..3c3e443 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -8304,9 +8304,9 @@ static void test_TransmitFile(void) iret = recv(dest, buf, sizeof(buf), 0); ok(iret == sizeof(header_msg)+sizeof(footer_msg)+2, "Returned an unexpected buffer from TransmitFile: %d\n", iret ); - ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)+1) == 0, + ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)) == 0, "TransmitFile header buffer did not match!\n"); - ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)+1) == 0, + ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)) == 0, "TransmitFile footer buffer did not match!\n");
Hi, you also have to change the sending lengths because it is also using +1. I believe this was a strlen/sizeof misfortune, right?
Best wishes, Bruno
Whoops, thanks for the pointer. (And I can only assume so; the code isn't mine.) --Zeb
On Sun, Jan 22, 2017 at 10:34 AM, Bruno Jesus <00cpxxx(a)gmail.com> wrote:
... Hi, you also have to change the sending lengths because it is also using +1. I believe this was a strlen/sizeof misfortune, right?
Yes, originally this was using strlen() and I wanted to capture the NULL byte so that it was easy to look at the data for diagnostics. At some point I must have changed it and forgot to remove the "+1", sorry about that :/ Best, Erich
participants (3)
-
Bruno Jesus -
Erich E. Hoover -
Zebediah Figura