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

gancho 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  1d173a7   Coverity 1373289: Explicit null dereferenced
1d173a7 is described below

commit 1d173a7cc8f2c82608d4151c12b07593296a73f2
Author: Gancho Tenev <gan...@apache.com>
AuthorDate: Tue May 9 07:48:32 2017 -0700

    Coverity 1373289: Explicit null dereferenced
    
    Problem:
      CID 1373289 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
      21. var_deref_model: Passing null pointer token to strcmp, which 
dereferences it.
    
    Fix:
      Check if token is NULL and if yes it cannot be equal to what is in hash
      (also hash is never NULL)
---
 example/secure_link/secure_link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/example/secure_link/secure_link.c 
b/example/secure_link/secure_link.c
index 3fe417d..7116021 100644
--- a/example/secure_link/secure_link.c
+++ b/example/secure_link/secure_link.c
@@ -118,7 +118,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo 
*rri)
   time(&t);
   e = (NULL == expire ? 0 : strtol(expire, NULL, 16));
   i = TSREMAP_DID_REMAP;
-  if (e < t || strcmp(hash, token) != 0) {
+  if (e < t || (NULL == token || 0 != strcmp(hash, token))) {
     if (e < t) {
       TSDebug(PLUGIN_NAME, "link expired: [%lu] vs [%lu]", t, e);
     } else {

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Reply via email to