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

(cherry picked from commit e4cdae71e1)
This commit is contained in:
evasques
2021-05-25 09:45:24 +01:00
committed by GitHub
parent c5ffc5fd4c
commit 36d2288d27

View File

@@ -716,7 +716,7 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
}
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
int idx = pathInfo.indexOf('/', 1);