commit 411705dfc04cf78985ab7532d8763747c24c7797
Author: FRIGN <[email protected]>
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
@@ -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),
@@ -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();


Reply via email to