From 7c6c127e854e9dbb4d444181ac1fb43510485848 Mon Sep 17 00:00:00 2001 From: FROZENCADET <51886109+FROZENCADET@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:28:40 +0530 Subject: [PATCH] Ensure indexOfPath is bigger than indexOfAt --- src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java index b86f4dc32a..8719d39042 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java @@ -437,7 +437,7 @@ private String parseUri(final String uri) { // For IPv6 address having more than one ":", it should look for the last occurrence final int indexOfPath = uri.lastIndexof(':'); - if (indexOfPath == -1) { + if (indexOfPath <= indexOfAt) { throw new BuildException("no remote path in %s", uri); }