Correctly NULL-terminate h_addr_list

This commit is contained in:
goldsimon 2010-05-17 12:36:45 +00:00
parent 3833dd86aa
commit d3e5ade2da
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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;