trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1196580 - in /trafficserver/traffic/trunk/lib/wccp: WccpEndPoint.cc WccpMsg.cc
Date Wed, 02 Nov 2011 13:46:54 GMT
Author: amc
Date: Wed Nov  2 13:46:54 2011
New Revision: 1196580

URL: http://svn.apache.org/viewvc?rev=1196580&view=rev
Log:
TS-1010: Reverting to strncpy in WCCP because strlcpy breaks the security key handling.

Modified:
    trafficserver/traffic/trunk/lib/wccp/WccpEndPoint.cc
    trafficserver/traffic/trunk/lib/wccp/WccpMsg.cc

Modified: trafficserver/traffic/trunk/lib/wccp/WccpEndPoint.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/wccp/WccpEndPoint.cc?rev=1196580&r1=1196579&r2=1196580&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/wccp/WccpEndPoint.cc (original)
+++ trafficserver/traffic/trunk/lib/wccp/WccpEndPoint.cc Wed Nov  2 13:46:54 2011
@@ -49,8 +49,7 @@ Impl::GroupData::GroupData()
 Impl::GroupData&
 Impl::GroupData::setKey(char const* key) {
   m_use_security_key = true;
-  memset(m_security_key, 0, SecurityComp::KEY_SIZE);
-  ink_strlcpy(m_security_key, key, SecurityComp::KEY_SIZE);
+  strncpy(m_security_key, key, SecurityComp::KEY_SIZE);
   return *this;
 }
 
@@ -146,7 +145,7 @@ Impl::useMD5Security(ts::ConstBuffer con
   m_use_security_key = true;
   memset(m_security_key, 0, SecurityComp::KEY_SIZE);
   // Great. Have to cast or we get a link error.
-  ink_strlcpy(m_security_key, key._ptr, std::min(key._size, static_cast<size_t>(SecurityComp::KEY_SIZE)));
+  memcpy(m_security_key, key._ptr, std::min(key._size, static_cast<size_t>(SecurityComp::KEY_SIZE)));
 }
 
 SecurityOption

Modified: trafficserver/traffic/trunk/lib/wccp/WccpMsg.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/wccp/WccpMsg.cc?rev=1196580&r1=1196579&r2=1196580&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/wccp/WccpMsg.cc (original)
+++ trafficserver/traffic/trunk/lib/wccp/WccpMsg.cc Wed Nov  2 13:46:54 2011
@@ -424,15 +424,13 @@ SecurityComp::setOption(Option opt) {
 SecurityComp&
 SecurityComp::setKey(char const* key) {
   m_local_key = true;
-  memset(m_key, 0, KEY_SIZE);
-  ink_strlcpy(m_key, key, KEY_SIZE);
+  strncpy(m_key, key, KEY_SIZE);
   return *this;
 }
 
 void
 SecurityComp::setDefaultKey(char const* key) {
-  memset(m_default_key, 0, KEY_SIZE);
-  ink_strlcpy(m_default_key, key, KEY_SIZE);
+  strncpy(m_default_key, key, KEY_SIZE);
 }
 
 SecurityComp&



Mime
View raw message