]> git.ipfire.org Git - people/ms/dnsmasq.git/blobdiff - src/forward.c
Fix stack-smashing crash in DNSSEC. Thanks to Henk Jan Agteresch.
[people/ms/dnsmasq.git] / src / forward.c
index ed853a3d05ef6417a5d6bdb0fd6d032a2dd5343b..073b2c9012d7020e2e41055bc9d3ae645d72d217 100644 (file)
@@ -1117,13 +1117,11 @@ void receive_query(struct listener *listen, time_t now)
   
   if (extract_request(header, (size_t)n, daemon->namebuff, &type))
     {
-      char types[20];
 #ifdef HAVE_AUTH
       struct auth_zone *zone;
 #endif
-
-      querystr(auth_dns ? "auth" : "query", types, type);
-
+      char *types = querystr(auth_dns ? "auth" : "query", type);
+      
       if (listen->family == AF_INET) 
        log_query(F_QUERY | F_IPV4 | F_FORWARD, daemon->namebuff, 
                  (struct all_addr *)&source_addr.in.sin_addr, types);
@@ -1290,11 +1288,10 @@ unsigned char *tcp_request(int confd, time_t now,
       
       if ((gotname = extract_request(header, (unsigned int)size, daemon->namebuff, &qtype)))
        {
-         char types[20];
 #ifdef HAVE_AUTH
          struct auth_zone *zone;
 #endif
-         querystr(auth_dns ? "auth" : "query", types, qtype);
+         char *types = querystr(auth_dns ? "auth" : "query", qtype);
          
          if (peer_addr.sa.sa_family == AF_INET) 
            log_query(F_QUERY | F_IPV4 | F_FORWARD, daemon->namebuff,