The patch didn't apply due to whitespace issues, so here is a rediffed version as a MIME attachment.

Matthew, please apply this, or I might be tempted to NMU it eventually (seeing as it's 220 days old..)

Thanks,

--
Joshua Kwan
diff --exclude '*changelog' -ur nstx-1.1-beta6/nstx_dns.c /home/sluo/nstx-1.1-beta6/nstx_dns.c
--- nstx-1.1-beta6/nstx_dns.c	2005-12-09 15:49:04.000000000 -0800
+++ /home/sluo/nstx-1.1-beta6/nstx_dns.c	2005-12-03 17:06:46.000000000 -0800
@@ -6,6 +6,7 @@
 #include <fcntl.h>
 #include <syslog.h>
 #include <unistd.h>
+#include <assert.h>
 
 #include "nstxfun.h"
 #include "nstxdns.h"
@@ -183,13 +184,13 @@
 static const unsigned char *
 lbl2data (const unsigned char *data, size_t len)
 {
-   static signed char *buf;
+   static signed char *buf = NULL;
    const unsigned char *s = data;
    signed char *d;
    signed int llen;
    
    d = buf = realloc(buf, len);
-   
+   assert(d);
    do
      {
 	llen = *s++;
@@ -336,7 +337,8 @@
      free(buf);
    
    off = strstr(fqdn, suffix);
-   if (off)
+   /* only parse if the fqdn was found, and there is more than the fqdn */
+   if (off && off != fqdn)
 	buf = strdup((char*)lbl2data((unsigned char*)fqdn, off - fqdn));
    else
 	/* Our suffix not found... */

Reply via email to