You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2018/05/09 15:29:09 UTC

[trafficserver] branch master updated: Fix Coverity ID 1022023

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

shinrich 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 319dd3c  Fix Coverity ID 1022023
319dd3c is described below

commit 319dd3cbfd02631ba627c4deceaf284317d2856f
Author: Susan Hinrichs <sh...@oath.com>
AuthorDate: Wed May 9 13:07:23 2018 +0000

    Fix Coverity ID 1022023
---
 proxy/http/HttpTransact.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 4f23bbc..12ddf0b 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5390,7 +5390,10 @@ HttpTransact::handle_trace_and_options_requests(State *s, HTTPHdr *incoming_hdr)
     return true;
   } else { /* max-forwards != 0 */
 
-    if ((max_forwards <= 0) || (max_forwards > INT_MAX)) {
+    // Logically want to make sure max_forwards is a legitimate non-zero non-negative integer
+    // Since max_fowards is a signed integer, no sense making sure it is less than INT_MAX.
+    // Would be negative in that case. Noted by coverity
+    if (max_forwards <= 0) {
       Log::error("HTTP: snapping invalid max-forwards value %d to %d", max_forwards, INT_MAX);
       max_forwards = INT_MAX;
     }

-- 
To stop receiving notification emails like this one, please contact
shinrich@apache.org.