trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sor...@apache.org
Subject trafficserver git commit: TS-3287: Add bounds checking to check tainted value
Date Thu, 05 Feb 2015 02:20:09 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 9fbc03104 -> 20b25d62e


TS-3287: Add bounds checking to check tainted value

Coverity CID #1214715


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/20b25d62
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/20b25d62
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/20b25d62

Branch: refs/heads/master
Commit: 20b25d62e9c3a19915b4dfc81552dac95e34fa44
Parents: 9fbc031
Author: Phil Sorber <sorber@apache.org>
Authored: Wed Feb 4 19:18:03 2015 -0700
Committer: Phil Sorber <sorber@apache.org>
Committed: Wed Feb 4 19:18:03 2015 -0700

----------------------------------------------------------------------
 plugins/experimental/url_sig/url_sig.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/20b25d62/plugins/experimental/url_sig/url_sig.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/url_sig/url_sig.c b/plugins/experimental/url_sig/url_sig.c
index 8e7af49..ea2a95b 100644
--- a/plugins/experimental/url_sig/url_sig.c
+++ b/plugins/experimental/url_sig/url_sig.c
@@ -135,8 +135,8 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int
errbuf_s
         }
       }
       TSDebug(PLUGIN_NAME, "key number %d == %s", keynum, value);
-      if (keynum > MAX_KEY_NUM || keynum == -1) {
-        snprintf(errbuf, errbuf_size - 1, "[TSRemapNewInstance] - Key number (%d) > MAX_KEY_NUM
(%d) or NaN.", keynum,
+      if (keynum >= MAX_KEY_NUM  || keynum < 0) {
+        snprintf(errbuf, errbuf_size - 1, "[TSRemapNewInstance] - Key number (%d) >= MAX_KEY_NUM
(%d) or NaN.", keynum,
                  MAX_KEY_NUM);
         fclose(file);
         free_cfg(cfg);


Mime
View raw message