Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 82125 invoked from network); 15 Jun 2005 01:39:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Jun 2005 01:39:26 -0000 Received: (qmail 94555 invoked by uid 500); 15 Jun 2005 01:39:24 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 94497 invoked by uid 500); 15 Jun 2005 01:39:23 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 94484 invoked by uid 99); 15 Jun 2005 01:39:23 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 14 Jun 2005 18:39:19 -0700 Received: (qmail 82024 invoked by uid 1203); 15 Jun 2005 01:39:08 -0000 Date: 15 Jun 2005 01:39:08 -0000 Message-ID: <20050615013908.82023.qmail@minotaur.apache.org> From: dims@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/java/src/org/apache/axis/transport/http CommonsHTTPSender.java HTTPSender.java X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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; }