Skip to content

Commit

Permalink
fix search when cannot unpack ber packet due to no attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavoluvizotto committed Apr 11, 2024
1 parent fe10864 commit ad842dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion v3/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,13 @@ func (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error) {
return result, ErrSizeLimitExceeded
}

attr := make([]*ber.Packet, 0)
if len(packet.Children[1].Children) > 1 {
attr = packet.Children[1].Children[1].Children
}
entry := &Entry{
DN: packet.Children[1].Children[0].Value.(string),
Attributes: unpackAttributes(packet.Children[1].Children[1].Children),
Attributes: unpackAttributes(attr),
}
result.Entries = append(result.Entries, entry)
case 5:
Expand Down

0 comments on commit ad842dc

Please sign in to comment.