From 13c1bb691be1b804e795aee75949d87141d81eb9 Mon Sep 17 00:00:00 2001 From: Jan Kalina Date: Wed, 29 Aug 2018 14:10:19 +0530 Subject: [PATCH] 8176553: LdapContext follows referrals infinitely ignoring set limit Reviewed-by: chegar --- .../com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java b/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java index 31b9c5c87d0..94c15c09d11 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -312,7 +312,8 @@ abstract class AbstractLdapNamingEnumeration if ((refEx != null) && (refEx.hasMoreReferrals() || - refEx.hasMoreReferralExceptions())) { + refEx.hasMoreReferralExceptions() + && !(errEx instanceof LimitExceededException))) { if (homeCtx.handleReferrals == LdapClient.LDAP_REF_THROW) { throw (NamingException)(refEx.fillInStackTrace());