Fix range error when minimizing the string

Closes #38778

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
Alexander Schwartz 2025-04-23 19:57:21 +02:00 committed by GitHub
parent b5fa1d0ba9
commit 3e0bb6dfbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -188,7 +188,7 @@ public class VerifyMessageProperties {
start++;
}
int end = 0;
while (end < sanitized.length() && end < value.length() && value.charAt(value.length() - end - 1) == sanitized.charAt(sanitized.length() - end - 1)) {
while (end < sanitized.length() - start && end < value.length() - start && value.charAt(value.length() - end - 1) == sanitized.charAt(sanitized.length() - end - 1)) {
end++;
}