mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Java: adjust BarrierPrefix to handle prepended chars
This commit is contained in:
@@ -389,7 +389,7 @@ public class UrlForwardTest extends HttpServlet implements Filter {
|
||||
}
|
||||
}
|
||||
|
||||
// Test `StringBuilder.append` sequence with `?` appended before the user input
|
||||
// GOOD: char `?` appended before the user input
|
||||
private static final String LOGIN_URL = "/UI/Login";
|
||||
|
||||
public void doPost2(HttpServletRequest request, HttpServletResponse response)
|
||||
@@ -399,14 +399,13 @@ public class UrlForwardTest extends HttpServlet implements Filter {
|
||||
|
||||
String queryString = request.getQueryString();
|
||||
|
||||
// should be sanitized due to the `?` appended
|
||||
forwardUrl.append('?').append(queryString);
|
||||
|
||||
String fUrl = forwardUrl.toString();
|
||||
|
||||
ServletConfig config = getServletConfig();
|
||||
|
||||
RequestDispatcher dispatcher = config.getServletContext().getRequestDispatcher(fUrl); // $ SPURIOUS: hasUrlForward
|
||||
RequestDispatcher dispatcher = config.getServletContext().getRequestDispatcher(fUrl);
|
||||
dispatcher.forward(request, response);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user