This issue fixed in 5.0u20 b04 see the CR 6862356, the fix was verified but fail in 5.0u22 b01 (rev and SE bundles).
workspace details :
-bash-3.00$ sccs prt Connection.java | more
D 1.28 09/08/06 11:04:32 asaha 30 29 00010/00019/00980
6864911: ASN.1/DER input stream parser needs more work
D 1.27 09/05/14 17:46:29 am207839 29 28 00014/00006/00985
Fixed 6748156: add an new JNDI property to control the boolean flag WaitForReply (JDK5) [vincent.ryan,Chris
Fixed 6750362: Very large LDAP requests throw a OOM on LDAP servers which aren't aware of Paged Results Con
This is a duplicate of CR 6862356
The 5u22b01 workspace contains fix for CR 6750362 but does not contain the follow on fix : 6862356
Created a new subCR in 6862356 for this issue and closing this as duplicate.