Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 061B010885 for ; Fri, 23 May 2014 05:44:02 +0000 (UTC) Received: (qmail 92024 invoked by uid 500); 23 May 2014 05:44:02 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 91997 invoked by uid 500); 23 May 2014 05:44:01 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 91989 invoked by uid 99); 23 May 2014 05:44:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2014 05:44:01 +0000 Date: Fri, 23 May 2014 05:44:01 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (CAMEL-7459) parseQuery Drops Char When Last Parameter is RAW with value ending in ')' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-7459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen reassigned CAMEL-7459: ---------------------------------- Assignee: Claus Ibsen > parseQuery Drops Char When Last Parameter is RAW with value ending in ')' > ------------------------------------------------------------------------- > > Key: CAMEL-7459 > URL: https://issues.apache.org/jira/browse/CAMEL-7459 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.11.0 > Reporter: Matthew Gill > Assignee: Claus Ibsen > Priority: Minor > Fix For: 2.12.4, 2.13.2, 2.14.0 > > > org.apache.camel.util.URISupport > When processing RAW parameters as part of parseQuery a look ahead to the next char is needed in order to determine the end of the RAW value. The logic to prevent a _StringIndexOutOfBoundsException_ drops the last char when evaluating for _next_ char when the current char (_i_) is the second to last char of the string. > This becomes an issue when the RAW value ends in ')' > Consider: > uri = "foo=RAW(ba(r))" > uri.length() = 14 > i = 12 > uri.charAt(12) = ')' > uri.charAt(13) = ')' > (i < uri.legnth() - 2) = 12 < (14 - 2) = 12 < 12 = false > thus next = "\u0000" > The RAW value now ends satisfying the requirements and the char at index 13 is never read. The resulting parameter is "foo=RAW(ba(r)". > The logic to prevent the index exception should be "(i <*=* uri.legnth() -2)" or "(i < uri.legnth() - *1*)" -- This message was sent by Atlassian JIRA (v6.2#6252)