[jboss-jira] [JBoss JIRA] (JBDEPLOY-278) DefaultStructureCache uses unescaped path as regex
Hui Wang (JIRA)
jira-events at lists.jboss.org
Wed Apr 24 04:52:54 EDT 2013
[ https://issues.jboss.org/browse/JBDEPLOY-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769781#comment-12769781 ]
Hui Wang commented on JBDEPLOY-278:
-----------------------------------
Hi James, I think it's better to assign this issue to dev, so that they can add the fix to the branch tag and it will be included in EAP 5.3.0 release.
> DefaultStructureCache uses unescaped path as regex
> --------------------------------------------------
>
> Key: JBDEPLOY-278
> URL: https://issues.jboss.org/browse/JBDEPLOY-278
> Project: JBoss Deployers
> Issue Type: Bug
> Components: vfs
> Affects Versions: JBDEPLOY-2.0.10.GA
> Reporter: James Livingston
> Attachments: JBDEPLOY-278.diff, JBDEPLOY-278.patch
>
>
> DefaultStructureCache.getLeaves() takes an unescaped pathName and then uses it as part of a regular expression. This could cause problems if pathName contained any characters that have special meaning in regexps.
> The method also creates a new Pattern object on each call which is relatively expensive.
> It could be fixed and the regex creation dropped by using the following:
> bool matches = key.startsWith(pathName) && (key.charAt(pathName.length) == '/') && (key.substring(pathName.length + 1).indexOf('/') == -1)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list