MNT-22316 - Added pathInfo length validation before attempting substring (#487) (#490)

(cherry picked from commit e4cdae71e1)
This commit is contained in:
evasques
2021-05-25 09:44:53 +01:00
committed by GitHub
parent 9e66a533e2
commit c0ba50d6f2

View File

@@ -716,7 +716,7 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
} }
else else
{ {
if(!pathInfo.substring(0, 6).toLowerCase().equals("/cmis/") && !pathInfo.equals("/discovery")) if((pathInfo.length() > 5 && !pathInfo.substring(0, 6).toLowerCase().equals("/cmis/")) && !pathInfo.equals("/discovery"))
{ {
// remove tenant // remove tenant
int idx = pathInfo.indexOf('/', 1); int idx = pathInfo.indexOf('/', 1);