Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scapy/layers/netbios.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ class NBNSQueryResponse(Packet):
]

def mysummary(self):
if not self.ADDR_ENTRY:
if not self.ADDR_ENTRY or \
not isinstance(self.ADDR_ENTRY[0], NBNS_ADD_ENTRY):
return "NBNSQueryResponse"
return "NBNSQueryResponse '\\\\%s' is at %s" % (
self.RR_NAME.decode(errors="backslashreplace"),
Expand Down
8 changes: 8 additions & 0 deletions test/scapy/layers/netbios.uts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ assert pkt[NBNSWackResponse].RR_NAME == b'SARAH'
z = raw(TCP()/NBTSession())
assert z == b'\x00\x8b\x00\x8b\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x00\x00\x00\x00\x00\x00\x00\x00'
assert NBTSession in TCP(z)

= OSS-Fuzz Findings

# Note: the packet is corrupted
with no_debug_dissector():
raw_packet = b'E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x05\x00\x00\x00'
packet = NBNSQueryResponse(raw_packet)
assert packet.summary() == "NBNSQueryResponse"
Loading