axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/transport/http CommonsHTTPSender.java HTTPSender.java
Date Wed, 15 Jun 2005 01:39:08 GMT
dims        2005/06/14 18:39:08

  Modified:    java/src/org/apache/axis/transport/http
                        CommonsHTTPSender.java HTTPSender.java
  Log:
  Prevent StringIndexOutOfBoundsException
  
  Revision  Changes    Path
  1.37      +3 -3      ws-axis/java/src/org/apache/axis/transport/http/CommonsHTTPSender.java
  
  Index: CommonsHTTPSender.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/transport/http/CommonsHTTPSender.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- CommonsHTTPSender.java	14 Jun 2005 10:40:04 -0000	1.36
  +++ CommonsHTTPSender.java	15 Jun 2005 01:39:08 -0000	1.37
  @@ -297,7 +297,7 @@
           
           cookie = cleanupCookie(cookie);
           int keyIndex = cookie.indexOf("=");
  -        String key = cookie.substring(0, keyIndex);
  +        String key = (keyIndex != -1) ? cookie.substring(0, keyIndex) : null;
           
           ArrayList cookies = new ArrayList();
           Object oldCookies = msgContext.getProperty(cookieName);
  @@ -307,7 +307,7 @@
                   String[] oldCookiesArray = (String[])oldCookies;
                   for(int i = 0; i < oldCookiesArray.length; i++) {
                       String anOldCookie = oldCookiesArray[i];
  -                    if (anOldCookie.indexOf(key) == 0) { // same cookie key
  +                    if (key != null && anOldCookie.indexOf(key) == 0) { // same
cookie key
                           anOldCookie = cookie;             // update to new one
                           alreadyExist = true;
                       }
  @@ -315,7 +315,7 @@
                   }
               } else {
   				String oldCookie = (String)oldCookies;
  -                if (oldCookie.indexOf(key) == 0) { // same cookie key
  +                if (key != null && oldCookie.indexOf(key) == 0) { // same cookie
key
   					oldCookie = cookie;             // update to new one
                       alreadyExist = true;
                   }
  
  
  
  1.133     +3 -3      ws-axis/java/src/org/apache/axis/transport/http/HTTPSender.java
  
  Index: HTTPSender.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/transport/http/HTTPSender.java,v
  retrieving revision 1.132
  retrieving revision 1.133
  diff -u -r1.132 -r1.133
  --- HTTPSender.java	14 Jun 2005 10:40:04 -0000	1.132
  +++ HTTPSender.java	15 Jun 2005 01:39:08 -0000	1.133
  @@ -813,7 +813,7 @@
   
           cookie = cleanupCookie(cookie);
           int keyIndex = cookie.indexOf("=");
  -        String key = cookie.substring(0, keyIndex);
  +        String key = (keyIndex != -1) ? cookie.substring(0, keyIndex) : null;
           
           ArrayList cookies = new ArrayList();
           Object oldCookies = msgContext.getProperty(cookieName);
  @@ -824,7 +824,7 @@
                   String[] oldCookiesArray = (String[])oldCookies;
                   for(int i = 0; i < oldCookiesArray.length; i++) {
                       String anOldCookie = oldCookiesArray[i];
  -                    if (anOldCookie.indexOf(key) == 0) { // same cookie key
  +                    if (key != null && anOldCookie.indexOf(key) == 0) { // same
cookie key
                           anOldCookie = cookie;             // update to new one
                           alreadyExist = true;
                       }
  @@ -832,7 +832,7 @@
                   }
               } else {
   				String oldCookie = (String)oldCookies;
  -                if (oldCookie.indexOf(key) == 0) { // same cookie key
  +                if (key != null && oldCookie.indexOf(key) == 0) { // same cookie
key
   					oldCookie = cookie;             // update to new one
                       alreadyExist = true;
                   }
  
  
  

Mime
View raw message