-
Bug
-
Resolution: Fixed
-
P3
-
7u72, 8, 9
-
b114
-
x86_64
-
solaris_10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8156385 | 8u111 | Sean Coffey | P3 | Resolved | Fixed | b01 |
JDK-8153714 | 8u102 | Sean Coffey | P3 | Resolved | Fixed | b03 |
JDK-8162221 | emb-8u111 | Sean Coffey | P3 | Resolved | Fixed | b01 |
JDK-8156720 | 7u121 | Sean Coffey | P3 | Resolved | Fixed | b01 |
JDK-8153966 | 7u111 | Sean Coffey | P3 | Resolved | Fixed | b03 |
JDK-8155876 | 7u101 | Sean Coffey | P3 | Resolved | Fixed | b32 |
JDK-8154392 | 7u85 | Sean Coffey | P3 | Resolved | Fixed | interim-patch |
JDK-8187203 | openjdk7u | Sean Coffey | P3 | Resolved | Fixed | master |
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) Server VM (build 24.72-b04, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
SunOS n3 5.10 Generic_150401-18 i86pc i386 i86pc
A DESCRIPTION OF THE PROBLEM :
When an LDAP response is received with status of LdapClient.LDAP_REFERRAL but no referrals are present (and handleReferrals is set to LDAP_REF_THROW), the following exception is received:
java.lang.NullPointerException
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2930)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2840)
at com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(LdapNamingEnumeration.java:147)
at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumeration.java:216)
at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration.java:189)
Looking at the source for LdapCtx, res.referrals.elementAt(0) is invoked without first testing that res.referrals is not null. Yes, this is technically an invalid LDAP message, but invalid messages should not result in null pointer exceptions in the stack.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Here is our code snippet that calls into search():
NamingEnumeration<SearchResult> enumeration = null;
try
{
setInterruptible(true);
scheduleInterruptTimerTask(timer, interruptTimerTask, interruptTimeLimit);
enumeration = ldapContext.search(ldapSearchArguments.getDn(), ldapSearchArguments.getFilter(),
searchControls);
SearchResult searchResult;
while (enumeration.hasMore())
{
searchResult = enumeration.next();
returnedAttributes.add(searchResult.getAttributes());
}
}
finally
{
cancelInterruptTimerTaskAndSetUnInterruptible(interruptTimerTask);
closeEnumeration(enumeration);
}
As mentioned in the Description, the LDAP response has a status of LdapClient.LDAP_REFERRAL but no referrals are present in the message.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The stack should be throwing some kind of NamingException rather than a null pointer exception.
ACTUAL -
See stack trace in Description.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
See stack trace in Description.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
We currently have to ignore referrals until this bug is fixed (i.e. handleReferrals is set to LDAP_REF_IGNORE).
- backported by
-
JDK-8153714 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
-
JDK-8153966 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
-
JDK-8154392 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
-
JDK-8155876 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
-
JDK-8156385 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
-
JDK-8156720 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
-
JDK-8162221 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
-
JDK-8187203 LdapCtx.processReturnCode() throwing Null Pointer Exception
- Resolved
- duplicates
-
JDK-8153730 NPE causing OAM's LDAP connection pool to get stuck
- Closed
- relates to
-
JDK-8154304 NullpointerException at LdapReferralException.getReferralContext
- Closed