Skip to content

Commit 1efdc1e

Browse files
authored
Fix LDAP test crash (#4568)
1 parent 4a66706 commit 1efdc1e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scapy/layers/ldap.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,14 @@ def tcp_reassemble(cls, data, *args, **kwargs):
963963
if length and len(x) >= length:
964964
remaining = x[length:]
965965
if not remaining:
966-
return cls(data)
966+
pkt = cls(data)
967+
# Packet can be a whole response yet still miss some content.
968+
if (
969+
LDAP_SearchResponseEntry in pkt and
970+
LDAP_SearchResponseResultDone not in pkt
971+
):
972+
return None
973+
return pkt
967974
else:
968975
return None
969976
return None

0 commit comments

Comments
 (0)