summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-24 23:51:57 +0000
committerJeremy Allison <jra@samba.org>2001-04-24 23:51:57 +0000
commita7e07d149d76a4d62aba6801ac648c0c72999ea9 (patch)
tree66630b32c913bf4821f479a50d946d8c51948f9f /source3
parentc5eca67b0a2fdfd43cef8f336048ccc6c23b32aa (diff)
downloadsamba-a7e07d149d76a4d62aba6801ac648c0c72999ea9.tar.gz
samba-a7e07d149d76a4d62aba6801ac648c0c72999ea9.tar.bz2
samba-a7e07d149d76a4d62aba6801ac648c0c72999ea9.zip
Fix bad length in dgram.
Jeremy. (This used to be commit 8bd27845f0d8b19409ba79c028ce54732d7276e1)
Diffstat (limited to 'source3')
-rw-r--r--source3/nmbd/nmbd_packets.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index 142268b0b0..3fa382b96f 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/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))
{