]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1799: Harmless 1 byte buffer overflow on long hostnames in /etc/hosts
authorhno <>
Sun, 5 Nov 2006 00:10:43 +0000 (00:10 +0000)
committerhno <>
Sun, 5 Nov 2006 00:10:43 +0000 (00:10 +0000)
src/tools.cc

index 30fffb534631b69eb3256df9f61012239c6d9ae6..4e81a13f480d2ad2bbb1cd63259bf8c6573ee11d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.271 2006/09/13 18:55:10 serassio Exp $
+ * $Id: tools.cc,v 1.272 2006/11/04 17:10:43 hno Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -1206,7 +1206,7 @@ parseEtcHosts(void)
             if (Config.appendDomain && !strchr(lt, '.')) {
                 /* I know it's ugly, but it's only at reconfig */
                 strncpy(buf2, lt, 512);
-                strncat(buf2, Config.appendDomain, 512 - strlen(lt));
+                strncat(buf2, Config.appendDomain, 512 - strlen(lt) - 1);
                 host = buf2;
             } else {
                 host = lt;