Issue Type: Bug Bug
Assignee: Joe Hansche
Components: confluence-publisher
Created: 25/Jun/12 6:08 AM
Description:

I found a second problem in the token matching logic of BetweenTokensEditor.java. The logic for finding the start token is:

final int start = content.indexOf(startMarkerToken) + startMarkerToken.length();
if (start < 0) { // exception }

However, as long as the startMarkerToken is defined, the sum of indexOf + length() will be non-negative whether the marker is found or not. If the marker length is 10, then the plugin will replace the page content starting from char 9 if the marker is not found, corrupting the page.

Obviously, the code should check whether indexOf(startMarkerToken) < 0, instead of checking the sum.

Project: Jenkins
Priority: Critical Critical
Reporter: Sampo Niskanen
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

Reply via email to