projects
/
project
/
uhttpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
listen: avoid invalid memory access
[project/uhttpd.git]
/
listen.c
diff --git
a/listen.c
b/listen.c
index 2a54888a8b80b68681e2ca7bbb17d0297f44c2e0..c5ba16f526751958ca76fcc2193212e4ad46cded 100644
(file)
--- a/
listen.c
+++ b/
listen.c
@@
-189,7
+189,7
@@
int uh_socket_bind(const char *host, const char *port, bool tls)
l->fd.fd = sock;
l->tls = tls;
-
l->addr = *(struct sockaddr_in6 *)p->ai_addr
;
+
memcpy(&l->addr, p->ai_addr, p->ai_addrlen)
;
list_add_tail(&l->list, &listeners);
bound++;