summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nmbd/nmbd_packets.c8
1 files changed, 5 insertions, 3 deletions
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 ) );
}