Module: wine
Branch: master
Commit: a787321d622c4920e362310d825726c67d66a217
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a787321d622c4920e362310d8…
Author: Bruno Jesus <00cpxxx(a)gmail.com>
Date: Thu Nov 26 13:22:12 2015 +0800
ws2_32/tests: Ensure we have more than one IP to test gethostbyname.
Sebastian called my attention about his machine that has a single IP and
make test fails. In such cases it is safe to assume that the IP returned
is the default route so the test is meaningless in this situation.
Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com>
Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/ws2_32/tests/sock.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 3c66f7d..f483197 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -4468,7 +4468,7 @@ static void test_gethostbyname(void)
struct hostent *he;
struct in_addr **addr_list;
char name[256], first_ip[16];
- int ret, i;
+ int ret, i, count;
PMIB_IPFORWARDTABLE routes = NULL;
PIP_ADAPTER_INFO adapters = NULL, k;
DWORD adap_size = 0, route_size = 0;
@@ -4484,9 +4484,9 @@ static void test_gethostbyname(void)
strcpy(first_ip, inet_ntoa(*addr_list[0]));
trace("List of local IPs:\n");
- for(i = 0; addr_list[i] != NULL; i++)
+ for(count = 0; addr_list[count] != NULL; count++)
{
- char *ip = inet_ntoa(*addr_list[i]);
+ char *ip = inet_ntoa(*addr_list[count]);
if (!strcmp(ip, "127.0.0.1"))
local_ip = TRUE;
trace("%s\n", ip);
@@ -4494,7 +4494,7 @@ static void test_gethostbyname(void)
if (local_ip)
{
- ok (i == 1, "expected 127.0.0.1 to be the only IP returned\n");
+ ok (count == 1, "expected 127.0.0.1 to be the only IP returned\n");
skip("Only the loopback address is present, skipping tests\n");
return;
}
@@ -4518,6 +4518,13 @@ static void test_gethostbyname(void)
ret = pGetIpForwardTable(routes, &route_size, FALSE);
ok (ret == NO_ERROR, "GetIpForwardTable failed, error: %d\n", ret);
+ /* This test only has meaning if there is more than one IP configured */
+ if (adapters->Next == NULL && count == 1)
+ {
+ skip("Only one IP is present, skipping tests\n");
+ goto cleanup;
+ }
+
for (i = 0; !found_default && i < routes->dwNumEntries; i++)
{
/* default route (ip 0.0.0.0) ? */
@@ -4541,6 +4548,7 @@ static void test_gethostbyname(void)
todo_wine
ok (found_default, "failed to find the first IP from gethostbyname!\n");
+cleanup:
HeapFree(GetProcessHeap(), 0, adapters);
HeapFree(GetProcessHeap(), 0, routes);
}
Module: wine
Branch: master
Commit: ebacf05258bc5f8db39cc13275e254390569b63d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ebacf05258bc5f8db39cc1327…
Author: Jiaxing Wang <hello.wjx(a)gmail.com>
Date: Thu Nov 26 05:22:40 2015 +0100
regedit: Need 3 bytes of room at end of buffer for \r\n\0 to avoid endless loop.
Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
programs/regedit/regproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index 643b559..2d766de 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -641,7 +641,7 @@ static void processRegLinesA(FILE *in, char* first_chars)
/* Do we need to expand the buffer ? */
assert (s >= line && s <= line + lineSize);
size_remaining = lineSize - (s-line);
- if (size_remaining < 2) /* room for 1 character and the \0 */
+ if (size_remaining < 3) /* need at least 3 bytes of room for \r\n\0 */
{
char *new_buffer;
size_t new_size = lineSize + REG_VAL_BUF_SIZE;