You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2017/05/11 13:41:08 UTC
[trafficserver] branch master updated (24e172a -> 527c019)
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.
from 24e172a coverity 1271330: Uninitialized pointer field
new f8794a0 WCCP: CV 1267996, 1267997, 1267988, 1267999 Fix va_end issues.
new bc73dd0 WCCP: CV 1268000, 1268001 CacheImpl::RouterData uninitialized members.
new 720f126 Wccp: CV-126003 - CapabilityElt initialization.
new b47483a Wccp: CV-128004
new 8a7956a Wccp: CV-1268005,CV-1268006,CV-1268007,CV-1268010
new 09ec306 Wccp: CV-1268011
new b95b275 Wccp: CV-1268012
new 8646ea7 Wccp: CV-1268015, 1268015, 1268016 Repalce strncpy with ink_strlcpy
new e6218fe Wccp: CV - fix compile issues with ats_scoped_fd
new 59b9251 Wccp: CV-1268018,1268019
new 527c019 Wccp: CV-1373294. 1373295, 137396, 137398, 137399 Disable taint check complaints. The sizes are validated before use.
The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
lib/wccp/WccpEndPoint.cc | 24 +++++++---------
lib/wccp/WccpLocal.h | 71 ++++++++++++++++++++++++++----------------------
lib/wccp/WccpMsg.cc | 9 ++++--
lib/wccp/WccpStatic.cc | 4 +++
4 files changed, 59 insertions(+), 49 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].
[trafficserver] 02/11: WCCP: CV 1268000,
1268001 CacheImpl::RouterData uninitialized members.
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit bc73dd0b0589bb4f32223196a3f68c200572e752
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 10:07:36 2017 -0500
WCCP: CV 1268000, 1268001
CacheImpl::RouterData uninitialized members.
---
lib/wccp/WccpLocal.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h
index 2f71779..0f0fcc8 100644
--- a/lib/wccp/WccpLocal.h
+++ b/lib/wccp/WccpLocal.h
@@ -391,10 +391,10 @@ public:
//@}
protected:
- uint32_t m_src_addr; ///< Source address mask.
- uint32_t m_dst_addr; ///< Destination address mask.
- uint16_t m_src_port; ///< Source port mask.
- uint16_t m_dst_port; ///< Destination port mask.
+ uint32_t m_src_addr = INADDR_ANY; ///< Source address mask.
+ uint32_t m_dst_addr = INADDR_ANY; ///< Destination address mask.
+ uint16_t m_src_port = 0; ///< Source port mask.
+ uint16_t m_dst_port = 0; ///< Destination port mask.
};
/// Sect 5.7.8: Value element.
@@ -2319,11 +2319,11 @@ namespace detail
bool m_assign; ///< Send a REDIRECT_ASSIGN.
bool m_send_caps; ///< Send capabilities.
/// Packet forwarding method selected.
- ServiceGroup::PacketStyle m_packet_forward;
+ ServiceGroup::PacketStyle m_packet_forward = ServiceConstants::NO_PACKET_STYLE;
/// Packet return method selected.
- ServiceGroup::PacketStyle m_packet_return;
+ ServiceGroup::PacketStyle m_packet_return = ServiceConstants::NO_PACKET_STYLE;
/// Cache assignment method selected.
- ServiceGroup::CacheAssignmentStyle m_cache_assign;
+ ServiceGroup::CacheAssignmentStyle m_cache_assign = ServiceConstants::NO_CACHE_ASSIGN_STYLE;
};
/// Data for a seeded router.
@@ -2354,11 +2354,11 @@ namespace detail
CacheIdBox m_id;
/// Packet forwarding methods supported.
- ServiceGroup::PacketStyle m_packet_forward;
+ ServiceGroup::PacketStyle m_packet_forward = ServiceConstants::NO_PACKET_STYLE;
/// Packet return methods supported.
- ServiceGroup::PacketStyle m_packet_return;
+ ServiceGroup::PacketStyle m_packet_return = ServiceConstants::NO_PACKET_STYLE;
/// Cache assignment methods supported.
- ServiceGroup::CacheAssignmentStyle m_cache_assign;
+ ServiceGroup::CacheAssignmentStyle m_cache_assign = ServiceConstants::NO_CACHE_ASSIGN_STYLE;
/// Known caches.
CacheBag m_caches;
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 05/11: Wccp: CV-1268005, CV-1268006, CV-1268007,
CV-1268010
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 8a7956a56645b92763498d7775863a9d57fdc6ac
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 10:49:05 2017 -0500
Wccp: CV-1268005,CV-1268006,CV-1268007,CV-1268010
---
lib/wccp/WccpEndPoint.cc | 5 +----
lib/wccp/WccpLocal.h | 24 +++++++++---------------
lib/wccp/WccpMsg.cc | 2 +-
3 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/lib/wccp/WccpEndPoint.cc b/lib/wccp/WccpEndPoint.cc
index 28a2d26..e89992b 100644
--- a/lib/wccp/WccpEndPoint.cc
+++ b/lib/wccp/WccpEndPoint.cc
@@ -61,10 +61,6 @@ Impl::GroupData::setSecurity(SecurityOption style)
return *this;
}
-Impl::Impl() : m_addr(INADDR_ANY), m_fd(ts::NO_FD)
-{
-}
-
Impl::~Impl()
{
this->close();
@@ -215,6 +211,7 @@ Impl::handleMessage()
recv_hdr.msg_iovlen = 1;
recv_hdr.msg_control = anc_buffer;
recv_hdr.msg_controllen = ANC_BUFFER_SIZE;
+ recv_hdr.msg_flags = 0; // output only, make Coverity shut up.
// coverity[uninit_use_in_call]
n = recvmsg(m_fd, &recv_hdr, MSG_TRUNC);
diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h
index 761df93..1de551f 100644
--- a/lib/wccp/WccpLocal.h
+++ b/lib/wccp/WccpLocal.h
@@ -327,7 +327,7 @@ public:
/// Capability types.
enum Type : uint16_t {
- NO_METHOD = 0; ///< Method not set.
+ NO_METHOD = 0, ///< Method not set.
PACKET_FORWARD_METHOD = 1, ///< Packet forwarding methods.
CACHE_ASSIGNMENT_METHOD = 2, ///< Cache assignment methods.
PACKET_RETURN_METHOD = 3 ///< Packet return methods.
@@ -577,9 +577,6 @@ class MaskAssignElt
public:
typedef MaskAssignElt self; ///< Self reference type.
- /// Default constructor - @b no initialization.
- MaskAssignElt();
-
/** A minimalist insert iterator.
*/
struct appender {
@@ -626,7 +623,7 @@ public:
size_t getVarSize() const;
protected:
- uint32_t m_count; ///< # of sets (network order).
+ uint32_t m_count = 0; ///< # of sets (network order).
friend struct appender;
};
@@ -2194,7 +2191,7 @@ public:
typedef detail::endpoint::GroupData GroupData;
/// Default constructor.
- Impl();
+ Impl() = default;
/** Set the local address used for this endpoint.
If not set, an arbitrary local address will be
@note This can only be called once, and must be called before
@@ -2251,13 +2248,13 @@ protected:
/** Local address for this end point.
This is set only when the socket is open.
*/
- uint32_t m_addr;
- int m_fd; ///< Our socket.
+ uint32_t m_addr = INADDR_ANY;
+ int m_fd = ts::NO_FD; ///< Our socket.
- bool m_use_security_opt; ///< Use group local security.
- SecurityComp::Option m_security_opt; ///< Type of security.
- bool m_use_security_key; ///< Use group local key.
- SecurityComp::Key m_security_key; ///< MD5 key.
+ bool m_use_security_opt = false; ///< Use group local security.
+ SecurityComp::Option m_security_opt = SECURITY_NONE; ///< Type of security.
+ bool m_use_security_key = false; ///< Use group local key.
+ SecurityComp::Key m_security_key; ///< MD5 key.
/// Close the socket.
void close();
@@ -3463,9 +3460,6 @@ inline HashAssignElt::Bucket const &HashAssignElt::operator[](size_t idx) const
return (*(const_cast<self *>(this)))[idx];
}
-inline MaskAssignElt::MaskAssignElt()
-{
-}
inline uint32_t
MaskAssignElt::getCount() const
{
diff --git a/lib/wccp/WccpMsg.cc b/lib/wccp/WccpMsg.cc
index d03283b..4544e1b 100644
--- a/lib/wccp/WccpMsg.cc
+++ b/lib/wccp/WccpMsg.cc
@@ -202,7 +202,7 @@ CapabilityElt::getCapType() const
inline CapabilityElt &
CapabilityElt::setCapType(Type cap)
{
- m_cap_type = htons(cap);
+ m_cap_type = static_cast<Type>(htons(cap));
return *this;
}
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 01/11: WCCP: CV 1267996, 1267997, 1267988,
1267999 Fix va_end issues.
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit f8794a0e1603175443cf059f407e424d8033bf83
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 09:32:05 2017 -0500
WCCP: CV 1267996, 1267997, 1267988, 1267999
Fix va_end issues.
---
lib/wccp/WccpStatic.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/wccp/WccpStatic.cc b/lib/wccp/WccpStatic.cc
index 3ee395f..caec397 100644
--- a/lib/wccp/WccpStatic.cc
+++ b/lib/wccp/WccpStatic.cc
@@ -132,6 +132,7 @@ logf(ts::Errata &err, ts::Errata::Id id, ts::Errata::Code code, char const *form
{
va_list rest;
va_start(rest, format);
+ va_end(rest);
return vlogf(err, id, code, format, rest);
}
@@ -141,6 +142,7 @@ logf(ts::Errata::Code code, char const *format, ...)
ts::Errata err;
va_list rest;
va_start(rest, format);
+ va_end(rest);
return vlogf(err, ts::Errata::Id(0), code, format, rest);
}
@@ -149,6 +151,7 @@ logf(ts::Errata &err, ts::Errata::Code code, char const *format, ...)
{
va_list rest;
va_start(rest, format);
+ va_end(rest);
return vlogf(err, ts::Errata::Id(0), code, format, rest);
}
@@ -186,6 +189,7 @@ logf_errno(ts::Errata::Code code, char const *format, ...)
{
va_list rest;
va_start(rest, format);
+ va_end(rest);
return vlogf_errno(code, format, rest);
}
// ------------------------------------------------------
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 09/11: Wccp: CV - fix compile issues with
ats_scoped_fd
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit e6218fe96e2466b7dc736254e109435e76680b9d
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 14:32:48 2017 -0500
Wccp: CV - fix compile issues with ats_scoped_fd
---
lib/wccp/WccpEndPoint.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/wccp/WccpEndPoint.cc b/lib/wccp/WccpEndPoint.cc
index 53ea9b4..72aa8bb 100644
--- a/lib/wccp/WccpEndPoint.cc
+++ b/lib/wccp/WccpEndPoint.cc
@@ -431,7 +431,7 @@ CacheImpl::GroupData::processUp()
zret = true; // No process to track, always chatter
} else {
// Look for the pid file
- ats_scoped_fd fd = open(proc_pid_path, O_RDONLY);
+ ats_scoped_fd fd{open(proc_pid_path, O_RDONLY)};
if (fd >= 0) {
char buffer[256];
ssize_t read_count = read(fd, buffer, sizeof(buffer) - 1);
@@ -441,7 +441,7 @@ CacheImpl::GroupData::processUp()
if (pid > 0) {
// If the process is still running, it has an entry in the proc file system, (Linux only)
sprintf(buffer, "/proc/%d/status", pid);
- ats_scoped_fd fd2 = open(buffer, O_RDONLY);
+ ats_scoped_fd fd2{open(buffer, O_RDONLY)};
if (fd2 >= 0) {
zret = true;
}
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 10/11: Wccp: CV-1268018,1268019
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 59b92516f3c34d3d1f3150ac25487259dfb59708
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 14:33:02 2017 -0500
Wccp: CV-1268018,1268019
---
lib/wccp/WccpLocal.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h
index 1de551f..80cac86 100644
--- a/lib/wccp/WccpLocal.h
+++ b/lib/wccp/WccpLocal.h
@@ -3438,17 +3438,20 @@ HashAssignElt::getSize() const
inline uint32_t
HashAssignElt::getAddr(int idx) const
{
+ // coverity[array_vs_singleton]
return (&m_count)[idx + 1];
}
inline HashAssignElt &
HashAssignElt::setAddr(int idx, uint32_t addr)
{
+ // coverity[array_vs_singleton]
(&m_count)[idx + 1] = addr;
return *this;
}
inline HashAssignElt::Bucket *
HashAssignElt::getBucketBase()
{
+ // coverity[array_vs_singleton]
return reinterpret_cast<Bucket *>((&m_count + 1 + this->getCount()));
}
inline HashAssignElt::Bucket &HashAssignElt::operator[](size_t idx)
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 04/11: Wccp: CV-128004
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit b47483a20e61f1b16c3d8b8336a1cb9c24be347e
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 10:45:36 2017 -0500
Wccp: CV-128004
---
lib/wccp/WccpLocal.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h
index 79773e2..761df93 100644
--- a/lib/wccp/WccpLocal.h
+++ b/lib/wccp/WccpLocal.h
@@ -1974,11 +1974,11 @@ namespace detail
struct GroupData {
typedef GroupData self; ///< Self reference type.
- ServiceGroup m_svc; ///< The service definition.
- uint32_t m_generation; ///< Generation value (change number).
- time_t m_generation_time; ///< Time of last view change.
+ ServiceGroup m_svc; ///< The service definition.
+ uint32_t m_generation; ///< Generation value (change number).
+ time_t m_generation_time = 0; ///< Time of last view change.
- bool m_use_security_opt; ///< Use group local security.
+ bool m_use_security_opt = false; ///< Use group local security.
SecurityComp::Option m_security_opt; ///< Type of security.
bool m_use_security_key; ///< Use group local key.
SecurityComp::Key m_security_key; ///< MD5 key.
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 03/11: Wccp: CV-126003 - CapabilityElt
initialization.
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 720f126a8df4df6f85a297ddf2a70adc496d1be4
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 10:36:55 2017 -0500
Wccp: CV-126003 - CapabilityElt initialization.
---
lib/wccp/WccpLocal.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h
index 0f0fcc8..79773e2 100644
--- a/lib/wccp/WccpLocal.h
+++ b/lib/wccp/WccpLocal.h
@@ -326,7 +326,8 @@ public:
typedef CapabilityElt self; ///< Self reference type.
/// Capability types.
- enum Type {
+ enum Type : uint16_t {
+ NO_METHOD = 0; ///< Method not set.
PACKET_FORWARD_METHOD = 1, ///< Packet forwarding methods.
CACHE_ASSIGNMENT_METHOD = 2, ///< Cache assignment methods.
PACKET_RETURN_METHOD = 3 ///< Packet return methods.
@@ -350,9 +351,9 @@ public:
);
//@}
protected:
- uint16_t m_cap_type; ///< Capability type.
- uint16_t m_cap_length; ///< Length of capability data.
- uint32_t m_cap_data; ///< Capability data.
+ enum Type m_cap_type = NO_METHOD; ///< Capability type.
+ uint16_t m_cap_length = 0; ///< Length of capability data.
+ uint32_t m_cap_data = 0; ///< Capability data.
};
/// Sect 5.7.7: Mask element
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 08/11: Wccp: CV-1268015, 1268015,
1268016 Repalce strncpy with ink_strlcpy
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 8646ea71b0f79d66f58225cfeebd4dd5c9344f63
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 14:01:10 2017 -0500
Wccp: CV-1268015, 1268015, 1268016
Repalce strncpy with ink_strlcpy
---
lib/wccp/WccpEndPoint.cc | 2 +-
lib/wccp/WccpMsg.cc | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/wccp/WccpEndPoint.cc b/lib/wccp/WccpEndPoint.cc
index 526856f..53ea9b4 100644
--- a/lib/wccp/WccpEndPoint.cc
+++ b/lib/wccp/WccpEndPoint.cc
@@ -49,7 +49,7 @@ Impl::GroupData &
Impl::GroupData::setKey(const char *key)
{
m_use_security_key = true;
- strncpy(m_security_key, key, SecurityComp::KEY_SIZE);
+ ink_strlcpy(m_security_key, key, SecurityComp::KEY_SIZE);
return *this;
}
diff --git a/lib/wccp/WccpMsg.cc b/lib/wccp/WccpMsg.cc
index 4544e1b..30f2a8b 100644
--- a/lib/wccp/WccpMsg.cc
+++ b/lib/wccp/WccpMsg.cc
@@ -449,14 +449,14 @@ SecurityComp &
SecurityComp::setKey(char const *key)
{
m_local_key = true;
- strncpy(m_key, key, KEY_SIZE);
+ ink_strlcpy(m_key, key, KEY_SIZE);
return *this;
}
void
SecurityComp::setDefaultKey(char const *key)
{
- strncpy(m_default_key, key, KEY_SIZE);
+ ink_strlcpy(m_default_key, key, KEY_SIZE);
}
SecurityComp &
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 07/11: Wccp: CV-1268012
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit b95b27508c507025f9d374c813e91aba9f01da84
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 12:31:04 2017 -0500
Wccp: CV-1268012
---
lib/wccp/WccpEndPoint.cc | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/wccp/WccpEndPoint.cc b/lib/wccp/WccpEndPoint.cc
index 8aec934..526856f 100644
--- a/lib/wccp/WccpEndPoint.cc
+++ b/lib/wccp/WccpEndPoint.cc
@@ -71,7 +71,7 @@ Impl::open(uint addr)
{
struct sockaddr saddr;
sockaddr_in &in_addr = reinterpret_cast<sockaddr_in &>(saddr);
- int fd;
+ ats_scoped_fd fd;
if (ts::NO_FD != m_fd) {
log(LVL_INFO, "Attempted to open already open WCCP Endpoint");
@@ -125,7 +125,7 @@ Impl::open(uint addr)
}
#endif
- m_fd = fd;
+ m_fd = fd.release();
return 0;
}
@@ -432,20 +432,18 @@ CacheImpl::GroupData::processUp()
} else {
// Look for the pid file
ats_scoped_fd fd = open(proc_pid_path, O_RDONLY);
- if (fd > 0) {
+ if (fd >= 0) {
char buffer[256];
ssize_t read_count = read(fd, buffer, sizeof(buffer) - 1);
- close(fd);
if (read_count > 0) {
buffer[read_count] = '\0';
int pid = atoi(buffer);
if (pid > 0) {
// If the process is still running, it has an entry in the proc file system, (Linux only)
sprintf(buffer, "/proc/%d/status", pid);
- fd = open(buffer, O_RDONLY);
- if (fd > 0) {
+ ats_scoped_fd fd2 = open(buffer, O_RDONLY);
+ if (fd2 >= 0) {
zret = true;
- close(fd);
}
}
}
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 11/11: Wccp: CV-1373294. 1373295, 137396, 137398,
137399 Disable taint check complaints. The sizes are validated
before use.
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 527c019201f20bba1de4cd368c2d5db9ed87d610
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 15:57:56 2017 -0500
Wccp: CV-1373294. 1373295, 137396, 137398, 137399
Disable taint check complaints. The sizes are validated before use.
---
lib/wccp/WccpEndPoint.cc | 5 +++--
lib/wccp/WccpLocal.h | 9 +++++++++
lib/wccp/WccpMsg.cc | 3 +++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/lib/wccp/WccpEndPoint.cc b/lib/wccp/WccpEndPoint.cc
index 72aa8bb..9e1a6b5 100644
--- a/lib/wccp/WccpEndPoint.cc
+++ b/lib/wccp/WccpEndPoint.cc
@@ -48,8 +48,9 @@ Impl::GroupData::GroupData() : m_generation(0), m_use_security_opt(false), m_use
Impl::GroupData &
Impl::GroupData::setKey(const char *key)
{
- m_use_security_key = true;
- ink_strlcpy(m_security_key, key, SecurityComp::KEY_SIZE);
+ if ((m_use_security_key = (key != nullptr))) {
+ ink_strlcpy(m_security_key, key, SecurityComp::KEY_SIZE);
+ }
return *this;
}
diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h
index 80cac86..9d5f4e5 100644
--- a/lib/wccp/WccpLocal.h
+++ b/lib/wccp/WccpLocal.h
@@ -3408,6 +3408,9 @@ RouterAssignListElt::getVarSize() const
{
return this->getSize() - sizeof(self);
}
+// This is untainted because an overall size check is done when the packet is read. If any of the
+// counts are bogus, that size check will fail.
+// coverity[ -tainted_data_return]
inline uint32_t
RouterAssignListElt::getCount() const
{
@@ -3420,6 +3423,9 @@ inline HashAssignElt::HashAssignElt()
inline HashAssignElt::HashAssignElt(int n) : m_count(htonl(n))
{
}
+// This is untainted because an overall size check is done when the packet is read. If any of the
+// counts are bogus, that size check will fail.
+// coverity[ -tainted_data_return]
inline uint32_t
HashAssignElt::getCount() const
{
@@ -3463,6 +3469,9 @@ inline HashAssignElt::Bucket const &HashAssignElt::operator[](size_t idx) const
return (*(const_cast<self *>(this)))[idx];
}
+// This is untainted because an overall size check is done when the packet is read. If any of the
+// counts are bogus, that size check will fail.
+// coverity[ -tainted_data_return]
inline uint32_t
MaskAssignElt::getCount() const
{
diff --git a/lib/wccp/WccpMsg.cc b/lib/wccp/WccpMsg.cc
index 30f2a8b..493ba1c 100644
--- a/lib/wccp/WccpMsg.cc
+++ b/lib/wccp/WccpMsg.cc
@@ -783,6 +783,9 @@ RouterViewComp::setChangeNumber(uint32_t n)
return *this;
}
+// This is untainted because an overall size check is done when the packet is read. If any of the
+// counts are bogus, that size check will fail.
+// coverity[ -tainted_data_return]
uint32_t
RouterViewComp::getCacheCount() const
{
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 06/11: Wccp: CV-1268011
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 09ec306f0995a8691969f3495635b0e8ff329956
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 11:48:49 2017 -0500
Wccp: CV-1268011
---
lib/wccp/WccpEndPoint.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/wccp/WccpEndPoint.cc b/lib/wccp/WccpEndPoint.cc
index e89992b..8aec934 100644
--- a/lib/wccp/WccpEndPoint.cc
+++ b/lib/wccp/WccpEndPoint.cc
@@ -431,7 +431,7 @@ CacheImpl::GroupData::processUp()
zret = true; // No process to track, always chatter
} else {
// Look for the pid file
- int fd = open(proc_pid_path, O_RDONLY);
+ ats_scoped_fd fd = open(proc_pid_path, O_RDONLY);
if (fd > 0) {
char buffer[256];
ssize_t read_count = read(fd, buffer, sizeof(buffer) - 1);
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.