projects
/
u
/
mdw
/
putty
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab076e0
)
If getaddrinfo() fails, it's not safe to dereference the struct addrinfo* it
author
ben
<ben@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Jan 2005 15:19:21 +0000
(15:19 +0000)
committer
ben
<ben@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Jan 2005 15:19:21 +0000
(15:19 +0000)
passes back to us, so don't.
git-svn-id: svn://svn.tartarus.org/sgt/putty@5167
cda61777
-01e9-0310-a592-
d414129be87e
unix/uxnet.c
patch
|
blob
|
blame
|
history
diff --git
a/unix/uxnet.c
b/unix/uxnet.c
index
b7c20cf
..
8804b09
100644
(file)
--- a/
unix/uxnet.c
+++ b/
unix/uxnet.c
@@
-713,8
+713,10
@@
Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i
hints.ai_next = NULL;
sprintf(portstr, "%d", port);
retcode = getaddrinfo(srcaddr, portstr, &hints, &ai);
- addr = ai->ai_addr;
- addrlen = ai->ai_addrlen;
+ if (retcode = 0) {
+ addr = ai->ai_addr;
+ addrlen = ai->ai_addrlen;
+ }
#else
memset(&a,'\0',sizeof(struct sockaddr_in));
a.sin_family = AF_INET;