Patch for nmbd core dump in printing debug packets. No length check.
authorJeremy Allison <jra@samba.org>
Tue, 24 Apr 2001 18:01:40 +0000 (18:01 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 24 Apr 2001 18:01:40 +0000 (18:01 +0000)
Jeremy.

source/nmbd/nmbd_packets.c

index 8b1029856119541051e0e3bea3bd58c38ac4628e..142268b0b01bfa93c0d313bc3852ce42f5817a19 100644 (file)
@@ -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 ) );
     }