You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/04/19 03:52:42 UTC
[trafficserver] branch master updated: Protect against LRUHash x = x
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 71d751c Protect against LRUHash x = x
71d751c is described below
commit 71d751c3c2070863f9f784da881d24a5260edd36
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Apr 18 16:58:20 2017 -0600
Protect against LRUHash x = x
This address clang-analyzer issue reported on master, after
we upgraded to v4.0.1.
---
plugins/experimental/cache_promote/cache_promote.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/plugins/experimental/cache_promote/cache_promote.cc b/plugins/experimental/cache_promote/cache_promote.cc
index f60a9e3..3128bad 100644
--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -152,7 +152,9 @@ public:
operator=(const LRUHash &h)
{
TSDebug(PLUGIN_NAME, "copying an LRUHash object");
- memcpy(_hash, h._hash, sizeof(_hash));
+ if (this != &h) {
+ memcpy(_hash, h._hash, sizeof(_hash));
+ }
return *this;
}
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].