mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 14:29:39 +00:00
Correctly NULL-terminate h_addr_list
This commit is contained in:
parent
3833dd86aa
commit
d3e5ade2da
@ -215,6 +215,9 @@ HISTORY
|
||||
|
||||
++ Bugfixes:
|
||||
|
||||
2010-05-17: Simon Goldschmidt
|
||||
* netdb.c: Correctly NULL-terminate h_addr_list
|
||||
|
||||
2010-05-16: Simon Goldschmidt
|
||||
* def.h/.c: changed the semantics of LWIP_PREFIX_BYTEORDER_FUNCS to prevent
|
||||
"symbol already defined" i.e. when linking to winsock
|
||||
|
@ -91,7 +91,7 @@ lwip_gethostbyname(const char *name)
|
||||
HOSTENT_STORAGE struct hostent s_hostent;
|
||||
HOSTENT_STORAGE char *s_aliases;
|
||||
HOSTENT_STORAGE ip_addr_t s_hostent_addr;
|
||||
HOSTENT_STORAGE ip_addr_t *s_phostent_addr;
|
||||
HOSTENT_STORAGE ip_addr_t *s_phostent_addr[2];
|
||||
|
||||
/* query host IP address */
|
||||
err = netconn_gethostbyname(name, &addr);
|
||||
@ -103,7 +103,8 @@ lwip_gethostbyname(const char *name)
|
||||
|
||||
/* fill hostent */
|
||||
s_hostent_addr = addr;
|
||||
s_phostent_addr = &s_hostent_addr;
|
||||
s_phostent_addr[0] = &s_hostent_addr;
|
||||
s_phostent_addr[1] = NULL;
|
||||
s_hostent.h_name = (char*)name;
|
||||
s_hostent.h_aliases = &s_aliases;
|
||||
s_hostent.h_addrtype = AF_INET;
|
||||
|
Loading…
Reference in New Issue
Block a user