Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D174245F4 for ; Sat, 25 Jun 2011 12:09:15 +0000 (UTC) Received: (qmail 66393 invoked by uid 500); 25 Jun 2011 12:09:14 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 66023 invoked by uid 500); 25 Jun 2011 12:09:13 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 66013 invoked by uid 99); 25 Jun 2011 12:09:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun 2011 12:09:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun 2011 12:09:10 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 61D1442FF61 for ; Sat, 25 Jun 2011 12:08:47 +0000 (UTC) Date: Sat, 25 Jun 2011 12:08:47 +0000 (UTC) From: "Andreas Veithen (JIRA)" To: java-dev@axis.apache.org Message-ID: <699771863.40324.1309003727397.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1828078863.34145.1308853787404.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (AXIS2-5078) Axis takes 100% CPU, infinite loop in the QueryStringParser MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Veithen resolved AXIS2-5078. ------------------------------------ Resolution: Fixed Fix Version/s: 1.7.0 1.6.1 1.5.6 Fixed. Thanks for providing the information necessary to reproduce this issue! > Axis takes 100% CPU, infinite loop in the QueryStringParser > ----------------------------------------------------------- > > Key: AXIS2-5078 > URL: https://issues.apache.org/jira/browse/AXIS2-5078 > Project: Axis2 > Issue Type: Bug > Components: kernel > Affects Versions: 1.5.5 > Environment: Mac, Linux > Reporter: Jonathan Ducharme > Assignee: Andreas Veithen > Fix For: 1.5.6, 1.6.1, 1.7.0 > > > Hi, > My problem is basically https://issues.apache.org/jira/browse/AXIS2-4736, but since it was closed without the step to reproduce, I've open a new issue, and will give you the code I made to test it. > Yes it's a malformed URL, but I think it's still an issue. > public static void main( String[] args ) { > QueryStringParser parser = new QueryStringParser("&gsdfgfds"); > parser.search( new ArrayList() ); > System.out.println("done"); > } > That being said, what I did is change the next() method by adding a check on the idx: > public boolean next() { > int len = queryString.length(); > if (paramEnd == len) { > return false; > } > paramBegin = paramEnd == 0 ? 0 : paramEnd+1; > int idx = queryString.indexOf('&', paramBegin); > > if(idx == 0) { > return false; > } > > paramEnd = idx == -1 ? len : idx; > idx = queryString.indexOf('=', paramBegin); > paramNameEnd = idx == -1 || idx > paramEnd ? paramEnd : idx; > paramName = null; > paramValue = null; > return true; > } > For our current needs it work, might not be the best solution, but for what we had to do it worked pretty well. This also pass the QueryStringParserTest that axis has. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org