[hackers] [quark] set host[0] = 0 at the beginning for more safety || FRIGN

From: <git_AT_suckless.org>
Date: Wed, 13 Aug 2014 19:36:01 +0200

commit 411705dfc04cf78985ab7532d8763747c24c7797
Author: FRIGN <dev_AT_frign.de>
Date: Wed Aug 13 19:37:36 2014 +0200

    set host[0] = 0 at the beginning for more safety

diff --git a/quark.c b/quark.c
index 361cb18..259b5cf 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -461,6 +461,7 @@ serve(int fd) {
                         close(fd);
 
                         /* get host */
+ host[0] = 0;
                         switch(sa.sa_family) {
                                 case AF_INET:
                                         inet_ntop(AF_INET, &(((struct sockaddr_in *)&sa)->sin_addr),
_AT_@ -470,8 +471,6 @@ serve(int fd) {
                                         inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)&sa)->sin6_addr),
                                                   host, sizeof host);
                                         break;
- default:
- host[0] = 0;
                         }
 
                         result = request();
Received on Wed Aug 13 2014 - 19:36:01 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 13 2014 - 19:36:09 CEST