This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new 77628a3  Protect against LRUHash x = x
77628a3 is described below

commit 77628a3f7551e6ff3cc7239b52082877978a3f06
Author: Leif Hedstrom <[email protected]>
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.
    
    (cherry picked from commit 71d751c3c2070863f9f784da881d24a5260edd36)
---
 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 e009f75..2b4347f 100644
--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -153,7 +153,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
['"[email protected]" <[email protected]>'].

Reply via email to