From 38227191ed2228ac6a07f826a68ace253cbd11dc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 24 Apr 2001 18:01:40 +0000 Subject: Patch for nmbd core dump in printing debug packets. No length check. Jeremy. (This used to be commit eacb96396d57d6b622b750d64b3686e6fbeaf68c) --- source3/nmbd/nmbd_packets.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 8b10298561..142268b0b0 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/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 ) ); } -- cgit