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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to