Module: wine
Branch: master
Commit: b2af5e1d311d409e725c67c731bf83c9fd8fdea6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b2af5e1d311d409e725c67c73…
Author: Bruno Jesus <00cpxxx(a)gmail.com>
Date: Sat Jun 9 14:34:59 2012 -0300
ws2_32: Fix hostent memory allocation.
---
dlls/ws2_32/socket.c | 75 +++++++++++++++++++++++++--------------------
dlls/ws2_32/tests/sock.c | 8 ++--
2 files changed, 46 insertions(+), 37 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index fd19ab2..b2bed09 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -326,7 +326,7 @@ static INT num_startup; /* reference counter */
static FARPROC blocking_hook = (FARPROC)WSA_DefaultBlockingHook;
/* function prototypes */
-static struct WS_hostent *WS_create_he(char *name, int aliases, int addresses, int fill_addresses);
+static struct WS_hostent *WS_create_he(char *name, int aliases, int aliases_size, int addresses, int address_length);
static struct WS_hostent *WS_dup_he(const struct hostent* p_he);
static struct WS_protoent *WS_dup_pe(const struct protoent* p_pe);
static struct WS_servent *WS_dup_se(const struct servent* p_se);
@@ -4557,7 +4557,7 @@ static struct WS_hostent* WS_get_local_ips( char *hostname )
/* Allocate a hostent and enough memory for all the IPs,
* including the NULL at the end of the list.
*/
- hostlist = WS_create_he(hostname, 1, numroutes+1, TRUE);
+ hostlist = WS_create_he(hostname, 1, 0, numroutes+1, sizeof(struct in_addr));
if (hostlist == NULL)
goto cleanup; /* Failed to allocate a hostent for the list of IPs */
hostlist->h_addr_list[numroutes] = NULL; /* NULL-terminate the address list */
@@ -5581,54 +5581,51 @@ static int list_dup(char** l_src, char** l_to, int item_size)
*
* Creates the entry with enough memory for the name, aliases
* addresses, and the address pointers. Also copies the name
- * and sets up all the pointers. If "fill_addresses" is set then
- * sufficient memory for the addresses is also allocated and the
- * address pointers are set to this memory.
+ * and sets up all the pointers.
*
* NOTE: The alias and address lists must be allocated with room
* for the NULL item terminating the list. This is true even if
* the list has no items ("aliases" and "addresses" must be
* at least "1", a truly empty list is invalid).
*/
-static struct WS_hostent *WS_create_he(char *name, int aliases, int addresses, int fill_addresses)
+static struct WS_hostent *WS_create_he(char *name, int aliases, int aliases_size, int addresses, int address_length)
{
struct WS_hostent *p_to;
char *p;
-
int size = (sizeof(struct WS_hostent) +
strlen(name) + 1 +
- sizeof(char *)*aliases +
- sizeof(char *)*addresses);
-
- /* Allocate enough memory for the addresses */
- if (fill_addresses)
- size += sizeof(struct in_addr)*addresses;
+ sizeof(char *) * aliases +
+ aliases_size +
+ sizeof(char *) * addresses +
+ address_length * (addresses - 1)), i;
if (!(p_to = check_buffer_he(size))) return NULL;
memset(p_to, 0, size);
+ /* Use the memory in the same way winsock does.
+ * First set the pointer for aliases, second set the pointers for addressess.
+ * Third fill the addresses indexes, fourth jump aliases names size.
+ * Fifth fill the hostname.
+ * NOTE: This method is valid for OS version's >= XP.
+ */
p = (char *)(p_to + 1);
- p_to->h_name = p;
- strcpy(p, name);
- p += strlen(p) + 1;
-
p_to->h_aliases = (char **)p;
p += sizeof(char *)*aliases;
+
p_to->h_addr_list = (char **)p;
p += sizeof(char *)*addresses;
- if (fill_addresses)
- {
- int i;
- /* NOTE: h_aliases must be filled in manually, leave these
- * pointers NULL (already set to NULL by memset earlier).
- */
+ for (i = 0, addresses--; i < addresses; i++, p += address_length)
+ p_to->h_addr_list[i] = p;
+
+ /* NOTE: h_aliases must be filled in manually because we don't know each string
+ * size, leave these pointers NULL (already set to NULL by memset earlier).
+ */
+ p += aliases_size;
+
+ p_to->h_name = p;
+ strcpy(p, name);
- /* Fill in the list of address pointers */
- for (i = 0; i < addresses; i++)
- p_to->h_addr_list[i] = (p += sizeof(struct in_addr));
- p += sizeof(struct in_addr);
- }
return p_to;
}
@@ -5638,18 +5635,30 @@ static struct WS_hostent *WS_create_he(char *name, int aliases, int addresses, i
*/
static struct WS_hostent *WS_dup_he(const struct hostent* p_he)
{
- int addresses = list_size(p_he->h_addr_list, p_he->h_length);
- int aliases = list_size(p_he->h_aliases, 0);
+ int i, addresses = 0, alias_size = 0;
struct WS_hostent *p_to;
+ char *p;
- p_to = WS_create_he(p_he->h_name, aliases, addresses, FALSE);
+ for( i = 0; p_he->h_aliases[i]; i++) alias_size += strlen(p_he->h_aliases[i]) + 1;
+ while (p_he->h_addr_list[addresses]) addresses++;
+
+ p_to = WS_create_he(p_he->h_name, i + 1, alias_size, addresses + 1, p_he->h_length);
if (!p_to) return NULL;
p_to->h_addrtype = p_he->h_addrtype;
p_to->h_length = p_he->h_length;
- list_dup(p_he->h_aliases, p_to->h_aliases, 0);
- list_dup(p_he->h_addr_list, p_to->h_addr_list, p_he->h_length);
+ for(i = 0, p = p_to->h_addr_list[0]; p_he->h_addr_list[i]; i++, p += p_to->h_length)
+ memcpy(p, p_he->h_addr_list[i], p_to->h_length);
+
+ /* Fill the aliases after the IP data */
+ for(i = 0; p_he->h_aliases[i]; i++)
+ {
+ p_to->h_aliases[i] = p;
+ strcpy(p, p_he->h_aliases[i]);
+ p += strlen(p) + 1;
+ }
+
return p_to;
}
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 85d126b..2543873 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -2759,22 +2759,22 @@ static void test_dns(void)
addr.mem = h + 1;
if(h->h_addr_list == addr.mem) /* <= W2K */
{
- skip("Skipping hostent tests since this OS is unsupported\n");
+ win_skip("Skipping hostent tests since this OS is unsupported\n");
return;
}
- todo_wine ok(h->h_aliases == addr.mem,
+ ok(h->h_aliases == addr.mem,
"hostent->h_aliases should be in %p, it is in %p\n", addr.mem, h->h_aliases);
for(ptr = h->h_aliases, acount = 1; *ptr; ptr++) acount++;
addr.chr += sizeof(*ptr) * acount;
- todo_wine ok(h->h_addr_list == addr.mem,
+ ok(h->h_addr_list == addr.mem,
"hostent->h_addr_list should be in %p, it is in %p\n", addr.mem, h->h_addr_list);
for(ptr = h->h_addr_list, acount = 1; *ptr; ptr++) acount++;
addr.chr += sizeof(*ptr) * acount;
- todo_wine ok(h->h_addr_list[0] == addr.mem,
+ ok(h->h_addr_list[0] == addr.mem,
"hostent->h_addr_list[0] should be in %p, it is in %p\n", addr.mem, h->h_addr_list[0]);
}
Module: website
Branch: master
Commit: 5b0bde81d255da470c4a27932697bc71fcad8d5d
URL: http://source.winehq.org/git/website.git/?a=commit;h=5b0bde81d255da470c4a27…
Author: Lucas Fialho Zawacki <lfzawacki(a)gmail.com>
Date: Mon Jun 11 13:11:35 2012 -0300
Added portuguese translation for release 1.5.6
---
news/pt/2012060801.xml | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/news/pt/2012060801.xml b/news/pt/2012060801.xml
new file mode 100644
index 0000000..b0e7dd9
--- /dev/null
+++ b/news/pt/2012060801.xml
@@ -0,0 +1,18 @@
+<news>
+<date>8 de Junho de 2012</date>
+<title>Wine 1.5.6 lançado</title>
+<body>
+<p> A versão de desenvolvimento 1.5.6 já está disponível.</p>
+<p> <a href="{$root}/announce/1.5.6">Novidades</a> desta versão:
+<ul>
+ <li>Instalação automática do pacote adicional Mono.</li>
+ <li>Applet do painel de controle para configuração de joysticks.</li>
+ <li>Renderização de bitmaps em dispostivos agora feita através da engine DIB.</li>
+ <li>Suporte a renderização de video através do DirectX (VMR-9).</li>
+ <li>Primeiros passos na direção de um compilador de shaders D3D.</li>
+ <li>Correções no build para DragonFly BSD.</li>
+ <li>Várias correções de bugs.</li>
+</ul></p>
+<p><p>O código fonte está <a href="http://prdownloads.sourceforge.net/wine/wine-1.5.6.tar.bz2">disponível agora</a>.
+Pacotes binários estão em processo de construção e em breve estarão em suas respectivas <a href="{$root}/download">sessões da área de downloads.</a>.
+</p></body></news>
Module: website
Branch: master
Commit: 03d05699fc2b892fc45ede9b20647691bec15976
URL: http://source.winehq.org/git/website.git/?a=commit;h=03d05699fc2b892fc45ede…
Author: André Hentschel <nerv(a)dawncrow.de>
Date: Sat Jun 9 15:27:15 2012 +0200
Wine 1.5.6 freigegeben
---
news/de/2012060801.xml | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/news/de/2012060801.xml b/news/de/2012060801.xml
new file mode 100644
index 0000000..dca71e8
--- /dev/null
+++ b/news/de/2012060801.xml
@@ -0,0 +1,18 @@
+<news>
+<date>8. Juni 2012</date>
+<title>Wine 1.5.6 freigegeben</title>
+<body>
+<p> Die Entwicklungsversion 1.5.6 von Wine ist jetzt verfügbar.</p>
+<p> <a href="{$root}/announce/1.5.6">Neuerungen (en)</a> in dieser Version:</p>
+<ul>
+ <li>Automatische Installation des Mono Add-on Pakets.</li>
+ <li>Systemsteuerungsapplet für Joysticks.</li>
+ <li>Geräteabhängige Bitmaps werden nun durch die DIB Engine gerendert.</li>
+ <li>Unterstützung für Videowiedergabe mit DirectX (VMR-9).</li>
+ <li>Erste Schritte in Richtungg eines D3D Shader Compilers.</li>
+ <li>Fehlerbehebungen für den Build unter DragonFly BSD.</li>
+ <li>Verschiedene Fehlerbehebungen.</li>
+</ul>
+<p>Der Quellcode ist jetzt <a href="http://prdownloads.sourceforge.net/wine/wine-1.5.6.tar.bz2">verfügbar</a>.
+Binärpakete werden gerade erstellt und stehen bald auf den jeweiligen <a href="{$root}/download">Downloadseiten</a> zur Verfügung.
+</p></body></news>
Module: website
Branch: master
Commit: 7e4c1005af43f84e24ae19487e150c716e7ddc30
URL: http://source.winehq.org/git/website.git/?a=commit;h=7e4c1005af43f84e24ae19…
Author: Łukasz Wojniłowicz <lukasz.wojnilowicz(a)gmail.com>
Date: Sat Jun 9 10:52:21 2012 +0200
Polish translation for release 1.5.6
---
news/pl/2012060801.xml | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/news/pl/2012060801.xml b/news/pl/2012060801.xml
new file mode 100644
index 0000000..5eaed3d
--- /dev/null
+++ b/news/pl/2012060801.xml
@@ -0,0 +1,18 @@
+<news>
+<date>Czerwiec 8, 2012</date>
+<title>Wydano Wine 1.5.6</title>
+<body>
+<p> Wydanie rozwojowe Wine 1.5.6 jest już dostępne.</p>
+<p> <a href="{$root}/announce/1.5.6">Co nowego</a> w tym wydaniu:
+<ul>
+ <li>Samoczynna instalacja dodatkowego pakietu Mono.</li>
+ <li>Aplet w panelu sterowania dla joysticków.</li>
+ <li>Renderowanie map bitowych zależnych od urządzenia od teraz jest wykonywane przez silnik DIB.</li>
+ <li>Wsparcie dla renderowania filmów przez DirectX (VMR-9).</li>
+ <li>Pierwsze kroki w kierunku utworzenia kompilatora cieniującego D3D.</li>
+ <li>Poprawki w budowaniu dla DragonFly BSD.</li>
+ <li>Rozmaite poprawki błędów.</li>
+</ul></p>
+<p><p>Źródło jest <a href="http://prdownloads.sourceforge.net/wine/wine-1.5.6.tar.bz2">już dostępne</a>.
+Paczki binarne są w trakcie budowy i ukażą się wkrótce w przeznaczonych dla nich <a href="{$root}/download">pobieralniach</a>.
+</p></body></news>