]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Wed, 4 Oct 2000 05:01:31 +0000 (05:01 +0000)
committerwessels <>
Wed, 4 Oct 2000 05:01:31 +0000 (05:01 +0000)
 - call xstrncpy *after* checking for NULL buffer.

src/fqdncache.cc

index a5a11997531e508bbf1a29767598f82f9cadb766..12cf3f49480b2d2dbec1c7c1c0a58843d0df172f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.137 2000/10/03 22:57:30 wessels Exp $
+ * $Id: fqdncache.cc,v 1.138 2000/10/03 23:01:31 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -208,14 +208,14 @@ fqdncacheParse(const char *inbuf)
     char *token;
     static fqdncache_entry f;
     int ttl;
-    xstrncpy(buf, inbuf, DNS_INBUF_SZ);
-    debug(35, 5) ("fqdncacheParse: parsing: {%s}\n", buf);
     f.expires = squid_curtime;
     f.flags.negcached = 1;
     if (inbuf == NULL) {
        debug(35, 1) ("fqdncacheParse: Got <NULL> reply\n");
        return &f;
     }
+    xstrncpy(buf, inbuf, DNS_INBUF_SZ);
+    debug(35, 5) ("fqdncacheParse: parsing: {%s}\n", buf);
     token = strtok(buf, w_space);
     if (NULL == token) {
        debug(35, 1) ("fqdncacheParse: Got <NULL>, expecting '$name'\n");