Skip to content

Commit b4a2421

Browse files
committed
Fixes
1 parent afcf3dd commit b4a2421

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

dissect/database/ese/ntds/database.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,11 @@ def children_of(self, dnt: int) -> Iterator[Object]:
201201
cursor.seek([dnt])
202202

203203
record = cursor.record()
204-
while record is not None and record != end:
204+
while record is not None:
205205
yield Object.from_record(self.db, record)
206+
if record == end:
207+
break
208+
206209
record = cursor.next()
207210

208211
def _make_dn(self, dnt: int) -> DN:

dissect/database/ese/ntds/query.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def _process_or_operation(self, filter: SearchFilter, records: Iterator[Record]
124124
Yields:
125125
Records matching any condition in the OR operation.
126126
"""
127+
records = list(records) if records is not None else None
127128
for child in filter.children:
128129
yield from self._process_query(child, records=records)
129130

@@ -186,8 +187,10 @@ def _process_wildcard_tail(index: Index, filter_value: str) -> Iterator[Record]:
186187

187188
# Yield all records in range
188189
record = cursor.record()
189-
while record is not None and record != end:
190+
while record is not None:
190191
yield record
192+
if record == end:
193+
break
191194
record = cursor.next()
192195

193196

0 commit comments

Comments
 (0)