-bugfixes
authorChristian Grothoff <christian@grothoff.org>
Wed, 4 Jan 2012 12:36:43 +0000 (12:36 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 4 Jan 2012 12:36:43 +0000 (12:36 +0000)
src/dns/Makefile.am
src/dns/dnsparser.c
src/dns/gnunet-service-dns_new.c

index 674f4bf57707bff731d6d360b856fe6961a57f45..6322f2ca65639a4e2d6459abde31efe2a200d6a1 100644 (file)
@@ -34,6 +34,9 @@ lib_LTLIBRARIES = \
 bin_PROGRAMS = \
   gnunet-service-dns gnunet-service-dns-new $(HIJACKBIN)
 
+noinst_PROGRAMS = \
+  gnunet-dns-monitor
+
 plugin_LTLIBRARIES = \
   libgnunet_plugin_block_dns.la 
 
@@ -55,6 +58,14 @@ gnunet_service_dns_LDADD = \
   $(top_builddir)/src/dns/libgnunetdnsparser.la \
   $(GN_LIBINTL)
 
+gnunet_dns_monitor_SOURCES = \
+ gnunet-dns-monitor.c
+gnunet_dns_monitor_LDADD = \
+  $(top_builddir)/src/dns/libgnunetdnsparser.la \
+  $(top_builddir)/src/dns/libgnunetdnsnew.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(GN_LIBINTL)
+
 gnunet_service_dns_new_SOURCES = \
  gnunet-service-dns_new.c 
 gnunet_service_dns_new_LDADD = \
index 2cd728f37d30d57c19421ec81aa9378601c329a2..2a3fd55c082ad5bc81182d46946c4e460ade0d17 100644 (file)
@@ -82,7 +82,7 @@ parse_name (const char *udp_payload,
   ret = GNUNET_strdup ("");
   while (1)
   {
-    if (*off == udp_payload_length)
+    if (*off >= udp_payload_length)
       goto error;
     len = input[*off];
     if (0 == len)
@@ -98,7 +98,7 @@ parse_name (const char *udp_payload,
                       &udp_payload[*off + 1]);
       GNUNET_free (ret);
       ret = tmp;
-      off += 1 + len;
+      *off += 1 + len;
     }
     else if ((64 | 128) == (len & (64 | 128)) )
     {
@@ -116,7 +116,7 @@ parse_name (const char *udp_payload,
       GNUNET_free (ret);
       GNUNET_free (xstr);
       ret = tmp;
-      off += 2;
+      *off += 2;
       /* pointers always terminate names */
       break;
     } 
index 8918039d171d9f5998acc02017d0ec8fb1638a51..bf2368faa2c50e82570191a8caf86e06af013a2d 100644 (file)
@@ -1049,10 +1049,11 @@ handle_client_response (void *cls GNUNET_UNUSED,
                           rr->client_wait_list_length,
                           0);
       }
-      next_phase (rr); 
-      GNUNET_SERVER_receive_done (client, GNUNET_OK);
-      return;
-    }  
+      break;
+    }
+    next_phase (rr); 
+    GNUNET_SERVER_receive_done (client, GNUNET_OK);
+    return;      
   }
   /* odd, client was not on our list for the request, that ought
      to be an error */