Skip to content

Commit

Permalink
Avoid a NullPointerException in SearchEntryParer
Browse files Browse the repository at this point in the history
Updated the logic that the LDAP SDK uses in the in-memory directory
server and the ldifsearch tool to pare matching entries based on a
set of requested attributes in the in-memory.  If an entry included
an attribute with an invalid name, then the logic used to parse
an attribute description into the base attribute type name and a set
of attribute options would result in a null pointer exception.  It
now uses more lenient logic for parsing attribute descriptions, and
it can handle malformed attribute descriptions in a more graceful
manner.
  • Loading branch information
dirmgr committed Nov 16, 2023
1 parent f485f6a commit 75aea3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 11 additions & 0 deletions docs/release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ <h3>Version 6.0.11</h3>
<br><br>
</li>

<li>
Updated the logic that the LDAP SDK uses in the in-memory directory server and
the ldifsearch tool to pare matching entries based on a set of requested
attributes in the in-memory. If an entry included an attribute with an invalid
name, then the logic used to parse an attribute description into the base
attribute type name and a set of attribute options would result in a null pointer
exception. It now uses more lenient logic for parsing attribute descriptions,
and it can handle malformed attribute descriptions in a more graceful manner.
<br><br>
</li>

<li>
Updated the TimestampArgument class to allow it to accept timestamps in the ISO
8601 format described in RFC 3339.
Expand Down
9 changes: 1 addition & 8 deletions src/com/unboundid/ldap/listener/SearchEntryParer.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,12 @@ else if (s.startsWith("@"))
*
* @return An {@code ObjectPair} in which the first element is the attribute
* type name and the second is the list of options (or an empty
* list if there are no options). Alternately, a value of
* {@code null} may be returned if the provided string does not
* represent a valid attribute type description.
* list if there are no options).
*/
@NotNull()
private static ObjectPair<String,List<String>> getNameWithOptions(
@NotNull final String s)
{
if (! Attribute.nameIsValid(s, true))
{
return null;
}

final String l = StaticUtils.toLowerCase(s);

int semicolonPos = l.indexOf(';');
Expand Down

0 comments on commit 75aea3f

Please sign in to comment.