diff options
author | Jeremy Allison <jra@samba.org> | 2001-04-24 23:51:57 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-04-24 23:51:57 +0000 |
commit | 8bd27845f0d8b19409ba79c028ce54732d7276e1 (patch) | |
tree | a219a7eb9c12918b2a99883553d409c9099d29b5 /source/nmbd | |
parent | 550cc5c182e88f742ac2052d80208da5f98e2543 (diff) | |
download | samba-8bd27845f0d8b19409ba79c028ce54732d7276e1.tar.gz samba-8bd27845f0d8b19409ba79c028ce54732d7276e1.tar.xz samba-8bd27845f0d8b19409ba79c028ce54732d7276e1.zip |
Fix bad length in dgram.
Jeremy.
Diffstat (limited to 'source/nmbd')
-rw-r--r-- | source/nmbd/nmbd_packets.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/nmbd/nmbd_packets.c b/source/nmbd/nmbd_packets.c index 142268b0b01..3fa382b96fe 100644 --- a/source/nmbd/nmbd_packets.c +++ b/source/nmbd/nmbd_packets.c @@ -1273,6 +1273,13 @@ an error packet of type %x\n", if (len <= 0) return; + if (buf2 + len > buf + sizeof(dgram->data)) { + DEBUG(2,("process_dgram: datagram from %s to %s IP %s for %s of type %d len=%d too long.\n", + nmb_namestr(&dgram->source_name),nmb_namestr(&dgram->dest_name), + inet_ntoa(p->ip), smb_buf(buf),CVAL(buf2,0),len)); + len = (buf + sizeof(dgram->data)) - buf; + } + /* Datagram packet received for the browser mailslot */ if (strequal(smb_buf(buf),BROWSE_MAILSLOT)) { |