changeset 52307:0f8e680269d4

8176553: LdapContext follows referrals infinitely ignoring set limit Reviewed-by: chegar Contributed-by: jkalina@redhat.com
author vtewari
date Wed, 29 Aug 2018 14:10:19 +0530
parents de411d537aae
children 7e5f08c619e3
files src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java	Wed Aug 29 09:36:17 2018 +0200
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java	Wed Aug 29 14:10:19 2018 +0530
@@ -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 @@
 
         if ((refEx != null) &&
             (refEx.hasMoreReferrals() ||
-             refEx.hasMoreReferralExceptions())) {
+             refEx.hasMoreReferralExceptions()
+                && !(errEx instanceof LimitExceededException))) {
 
             if (homeCtx.handleReferrals == LdapClient.LDAP_REF_THROW) {
                 throw (NamingException)(refEx.fillInStackTrace());