tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper Mapper.java
Date Fri, 07 Mar 2003 16:03:33 GMT
remm        2003/03/07 08:03:33

  Modified:    util/java/org/apache/tomcat/util/http/mapper Mapper.java
  Log:
  - Add checks if find returns -1.
  
  Revision  Changes    Path
  1.10      +18 -0     jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Mapper.java	6 Mar 2003 17:14:47 -0000	1.9
  +++ Mapper.java	7 Mar 2003 16:03:33 -0000	1.10
  @@ -189,6 +189,9 @@
   
           Host[] hosts = this.hosts;
           int pos = find(hosts, hostName);
  +        if (pos < 0) {
  +            return;
  +        }
           Host host = hosts[pos];
           if (host.name.equals(hostName)) {
               Context[] contexts = host.contexts;
  @@ -217,6 +220,9 @@
       public void removeContext(String hostName, String path) {
           Host[] hosts = this.hosts;
           int pos = find(hosts, hostName);
  +        if (pos < 0) {
  +            return;
  +        }
           Host host = hosts[pos];
           if (host.name.equals(hostName)) {
               Context[] contexts = host.contexts;
  @@ -242,10 +248,16 @@
           (String hostName, String contextPath, String path, Object wrapper) {
           Host[] hosts = this.hosts;
           int pos = find(hosts, hostName);
  +        if (pos < 0) {
  +            return;
  +        }
           Host host = hosts[pos];
           if (host.name.equals(hostName)) {
               Context[] contexts = host.contexts;
               int pos2 = find(contexts, contextPath);
  +            if (pos2 < 0) {
  +                return;
  +            }
               Context context = contexts[pos2];
               if (context.name.equals(contextPath)) {
                   synchronized (context) {
  @@ -300,10 +312,16 @@
           (String hostName, String contextPath, String path) {
           Host[] hosts = this.hosts;
           int pos = find(hosts, hostName);
  +        if (pos < 0) {
  +            return;
  +        }
           Host host = hosts[pos];
           if (host.name.equals(hostName)) {
               Context[] contexts = host.contexts;
               int pos2 = find(contexts, contextPath);
  +            if (pos2 < 0) {
  +                return;
  +            }
               Context context = contexts[pos2];
               if (context.name.equals(contextPath)) {
                   synchronized (context) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message