Skip to content

Commit

Permalink
Fix LDAP test crash (#4568)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 authored Oct 14, 2024
1 parent 4a66706 commit 1efdc1e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scapy/layers/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,14 @@ def tcp_reassemble(cls, data, *args, **kwargs):
if length and len(x) >= length:
remaining = x[length:]
if not remaining:
return cls(data)
pkt = cls(data)
# Packet can be a whole response yet still miss some content.
if (
LDAP_SearchResponseEntry in pkt and
LDAP_SearchResponseResultDone not in pkt
):
return None
return pkt
else:
return None
return None
Expand Down

0 comments on commit 1efdc1e

Please sign in to comment.