ws2_32: Fix hostent memory allocation (try 3, resend)
00cpxxx at gmail.com
Sat Jun 9 12:34:59 CDT 2012
try 3, resend:
Rebased on top of latest wine.
Avoid messing with the helper functions.
Removed documentation from small functions.
Removed optional parameters from list_size.
Currently WS_create_he is used in 2 different places with incompatible
arguments. The first call assumes that the parameters are the number
of items (aliases/addresses)  the second call assumes the
parameters are the required amount of bytes to alloc . The second
call is clearly wrong because WS_create_he multiply the parameters by
sizeof(char*) so the current approach allocates way more memory than
required when gethostbyname is called. This patch normalizes
WS_create_he making it more flexible and allowing the correct
allocation of memory. It also make list_dup and list_size more
flexible so they can be used in different ways allowing to get
separate amount of data and item count in list_size and allowing
list_dup to start copying items from a different point.
Fixes bug 3962.
 = http://source.winehq.org/source/dlls/ws2_32/socket.c#L4559
 = http://source.winehq.org/source/dlls/ws2_32/socket.c#L5644
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6629 bytes
Desc: not available
More information about the wine-patches