Repository: trafficserver
Updated Branches:
  refs/heads/master 98ea180cc -> f16c7615a


TS-1475: Coverity 1242015 Buffer not null terminated


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f16c7615
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f16c7615
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f16c7615

Branch: refs/heads/master
Commit: f16c7615a4f9a824f011e759789331f04b945551
Parents: 98ea180
Author: Leif Hedstrom <[email protected]>
Authored: Tue Sep 30 08:28:50 2014 -0600
Committer: Leif Hedstrom <[email protected]>
Committed: Tue Sep 30 08:28:50 2014 -0600

----------------------------------------------------------------------
 iocore/net/SSLUtils.cc | 2 +-
 lib/ts/ink_string.cc   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f16c7615/iocore/net/SSLUtils.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index a807e2b..c399be7 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -197,7 +197,7 @@ ssl_servername_callback(SSL * ssl, int * ad, void * /*arg*/)
     netvc->getSSLHandShakeComplete());
 
   if (servername != NULL) {
-    strncpy(netvc->sniServername, servername, TS_MAX_HOST_NAME_LEN);
+    ink_strlcpy(netvc->sniServername, servername, TS_MAX_HOST_NAME_LEN);
   }
 
   // catch the client renegotiation early on

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f16c7615/lib/ts/ink_string.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.cc b/lib/ts/ink_string.cc
index 3ce655a..3307381 100644
--- a/lib/ts/ink_string.cc
+++ b/lib/ts/ink_string.cc
@@ -231,7 +231,7 @@ ink_strlcpy(char *dst, const char *src, size_t siz)
   /* Not enough room in dst, add NUL and traverse rest of src */
   if (n == 0) {
     if (siz != 0)
-                            *d = '\0';      /* NUL-terminate dst */
+      *d = '\0';      /* NUL-terminate dst */
     while (*s++)
       ;
   }

Reply via email to