set host[0] = 0 at the beginning for more safety
This commit is contained in:
parent
8001703f50
commit
411705dfc0
1 changed files with 1 additions and 2 deletions
3
quark.c
3
quark.c
|
@ -461,6 +461,7 @@ serve(int fd) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
/* get host */
|
/* get host */
|
||||||
|
host[0] = 0;
|
||||||
switch(sa.sa_family) {
|
switch(sa.sa_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
inet_ntop(AF_INET, &(((struct sockaddr_in *)&sa)->sin_addr),
|
inet_ntop(AF_INET, &(((struct sockaddr_in *)&sa)->sin_addr),
|
||||||
|
@ -470,8 +471,6 @@ serve(int fd) {
|
||||||
inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)&sa)->sin6_addr),
|
inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)&sa)->sin6_addr),
|
||||||
host, sizeof host);
|
host, sizeof host);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
host[0] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result = request();
|
result = request();
|
||||||
|
|
Loading…
Reference in a new issue