]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: strcpy->strncpy in pconn.cc.
authorrobertc <>
Mon, 23 Jun 2003 18:11:45 +0000 (18:11 +0000)
committerrobertc <>
Mon, 23 Jun 2003 18:11:45 +0000 (18:11 +0000)
Keywords:

Whilst debugging, I noticed we don't use strncpy - converted for safety.

src/pconn.cc

index d40ca42590cfb89434d6bd46dd6ba55bba861953..54c0a8d74896c5e101408ee489ab61acf88f7bcc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: pconn.cc,v 1.38 2003/06/22 07:47:43 robertc Exp $
+ * $Id: pconn.cc,v 1.39 2003/06/23 12:11:45 robertc Exp $
  *
  * DEBUG: section 48    Persistent Connections
  * AUTHOR: Duane Wessels
@@ -262,7 +262,7 @@ pconnPush(int fd, const char *host, u_short port, const char *domain)
     }
 
     assert(table != NULL);
-    strcpy(key, pconnKey(host, port, domain));
+    strncpy(key, pconnKey(host, port, domain), SQUIDHOSTNAMELEN + 10);
 
     p = (struct _pconn *) hash_lookup(table, key);
 
@@ -309,7 +309,7 @@ pconnPop(const char *host, u_short port, const char *domain)
     int fd = -1;
     LOCAL_ARRAY(char, key, SQUIDHOSTNAMELEN + 10);
     assert(table != NULL);
-    strcpy(key, pconnKey(host, port, domain));
+    strncpy(key, pconnKey(host, port, domain), SQUIDHOSTNAMELEN + 10);
     hptr = (hash_link *)hash_lookup(table, key);
 
     if (hptr != NULL) {