You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2014/07/15 22:04:06 UTC

git commit: TS-1475: fix possible file arguments overflow

Repository: trafficserver
Updated Branches:
  refs/heads/master 5ab707433 -> 397a2d68c


TS-1475: fix possible file arguments overflow

Coverity #1021860


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

Branch: refs/heads/master
Commit: 397a2d68caaff6f415276b4b8d7cec757c187405
Parents: 5ab7074
Author: James Peach <jp...@apache.org>
Authored: Tue Jul 15 13:54:41 2014 -0600
Committer: James Peach <jp...@apache.org>
Committed: Tue Jul 15 14:02:35 2014 -0600

----------------------------------------------------------------------
 lib/ts/ink_args.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/397a2d68/lib/ts/ink_args.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_args.cc b/lib/ts/ink_args.cc
index 59722ef..528ab16 100644
--- a/lib/ts/ink_args.cc
+++ b/lib/ts/ink_args.cc
@@ -191,8 +191,9 @@ process_args(const ArgumentDescription * argument_descriptions, unsigned n_argum
           usage(argument_descriptions, n_argument_descriptions, usage_string);
       }
     } else {
-      if (n_file_arguments > MAX_FILE_ARGUMENTS)
-        ink_fatal(1, (char *) "too many files");
+      if (n_file_arguments >= countof(file_arguments)) {
+        ink_fatal(1, "too many files");
+      }
       file_arguments[n_file_arguments++] = *argv;
       file_arguments[n_file_arguments] = NULL;
     }