]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Memory corruption in IPAddress::ToURL, called when printing out IPAddress values
authorhno <>
Thu, 27 Dec 2007 07:48:06 +0000 (07:48 +0000)
committerhno <>
Thu, 27 Dec 2007 07:48:06 +0000 (07:48 +0000)
lib/IPAddress.cc

index 4ec5014d699b68706090503324005ae1488bae29..47e104c282e41eeb660262adde6a06c665eada40 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: IPAddress.cc,v 1.2 2007/12/26 23:59:28 hno Exp $
+ * $Id: IPAddress.cc,v 1.3 2007/12/27 00:48:06 hno Exp $
  *
  * DEBUG: section 14   IP Storage and Handling
  * AUTHOR: Amos Jeffries
@@ -1060,7 +1060,7 @@ char* IPAddress::ToURL(char* buf, unsigned int blen) const
     }
 
     // force a null-terminated string
-    buf[blen] = '\0';
+    buf[blen-1] = '\0';
 
     return buf;
 }