You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2014/05/23 09:01:07 UTC
[jira] [Resolved] (CAMEL-7459) parseQuery Drops Char When Last
Parameter is RAW with value ending in ')'
[ https://issues.apache.org/jira/browse/CAMEL-7459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-7459.
--------------------------------
Resolution: Fixed
Thanks.
> 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)