mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-10 23:58:06 -05:00
sk_nonamelookup() should ensure the sockaddr it returns has `error'
set to NULL. Otherwise it'll be random uninitialised goop. Not good. [originally from svn r2416]
This commit is contained in:
parent
327b9b7f1a
commit
2435c54597
@ -203,6 +203,7 @@ SockAddr sk_namelookup(char *host, char **canonicalname)
|
||||
SockAddr sk_nonamelookup(char *host)
|
||||
{
|
||||
SockAddr ret = smalloc(sizeof(struct SockAddr_tag));
|
||||
ret->error = NULL;
|
||||
ret->family = AF_UNSPEC;
|
||||
strncpy(ret->hostname, host, lenof(ret->hostname));
|
||||
ret->hostname[lenof(ret->hostname)-1] = '\0';
|
||||
|
1
winnet.c
1
winnet.c
@ -365,6 +365,7 @@ SockAddr sk_namelookup(char *host, char **canonicalname)
|
||||
SockAddr sk_nonamelookup(char *host)
|
||||
{
|
||||
SockAddr ret = smalloc(sizeof(struct SockAddr_tag));
|
||||
ret->error = NULL;
|
||||
ret->family = AF_UNSPEC;
|
||||
strncpy(ret->hostname, host, lenof(ret->hostname));
|
||||
ret->hostname[lenof(ret->hostname)-1] = '\0';
|
||||
|
Loading…
x
Reference in New Issue
Block a user