This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new ceaa2ac Check earlier for valid first character ceaa2ac is described below commit ceaa2ac9cf3df2fb8bf171db57e5a1d0f35d5551 Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org> AuthorDate: Tue Aug 25 14:28:11 2020 +0300 Check earlier for valid first character Move the check for the possible characters in the first position --- java/org/apache/catalina/connector/CoyoteAdapter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java index ddbf14f..915a2c6 100644 --- a/java/org/apache/catalina/connector/CoyoteAdapter.java +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java @@ -1151,6 +1151,12 @@ public class CoyoteAdapter implements Adapter { int pos = 0; int index = 0; + + // The URL must start with '/' (or '\' that will be replaced soon) + if (b[start] != (byte) '/' && b[start] != (byte) '\\') { + return false; + } + // Replace '\' with '/' // Check for null byte for (pos = start; pos < end; pos++) { @@ -1166,11 +1172,6 @@ public class CoyoteAdapter implements Adapter { } } - // The URL must start with '/' - if (b[start] != (byte) '/') { - return false; - } - // Replace "//" with "/" for (pos = start; pos < (end - 1); pos++) { if (b[pos] == (byte) '/') { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org