diff options
author | Jeremy Allison <jra@samba.org> | 2001-04-24 18:01:40 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-04-24 18:01:40 +0000 |
commit | eacb96396d57d6b622b750d64b3686e6fbeaf68c (patch) | |
tree | f1f3fec4ed22771856fb54fe1004567e9ab191a8 | |
parent | 9db84de46a3823878c2a9356ac4ae4fd179d5847 (diff) | |
download | samba-eacb96396d57d6b622b750d64b3686e6fbeaf68c.tar.gz samba-eacb96396d57d6b622b750d64b3686e6fbeaf68c.tar.xz samba-eacb96396d57d6b622b750d64b3686e6fbeaf68c.zip |
Patch for nmbd core dump in printing debug packets. No length check.
Jeremy.
-rw-r--r-- | source/nmbd/nmbd_packets.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/nmbd/nmbd_packets.c b/source/nmbd/nmbd_packets.c index 8b102985611..142268b0b01 100644 --- a/source/nmbd/nmbd_packets.c +++ b/source/nmbd/nmbd_packets.c @@ -107,12 +107,14 @@ static void debug_browse_data(char *outbuf, int len) for (j = 0; j < 16; j++) { - unsigned char x = outbuf[i+j]; + unsigned char x; + if (i+j >= len) + break; + + x = outbuf[i+j]; if (x < 32 || x > 127) x = '.'; - if (i+j >= len) - break; DEBUGADD( 4, ( "%c", x ) ); } |