From 57cce28b0465282b2944983e1df4d30eafb9ee18 Mon Sep 17 00:00:00 2001 From: Guillaume Valadon Date: Thu, 5 Sep 2024 20:01:45 +0200 Subject: [PATCH] Check LDAP fields --- scapy/layers/ldap.py | 2 ++ test/regression.uts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/scapy/layers/ldap.py b/scapy/layers/ldap.py index 494809a6ab7..26db10ce838 100644 --- a/scapy/layers/ldap.py +++ b/scapy/layers/ldap.py @@ -729,6 +729,8 @@ def answers(self, other): return isinstance(other, LDAP) and other.messageID == self.messageID def mysummary(self): + if not self.protocolOp or not self.messageID: + return "" return ( "%s(%s)" % ( diff --git a/test/regression.uts b/test/regression.uts index e182f92b96e..09296a0b141 100644 --- a/test/regression.uts +++ b/test/regression.uts @@ -2338,6 +2338,11 @@ except Scapy_Exception: file = BytesIO(b"\n\r\r\n\x00\x00\x008\x1a+