From 3eade55dc7c842bdc50205c330802d211fae54d3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Aug 1998 03:11:42 +0000 Subject: bounds check next_token() to prevent possible buffer overflows --- source/nmbd/nmbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/nmbd/nmbd.c') diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index 9210ce4dcf8..feb9c2420e3 100644 --- a/source/nmbd/nmbd.c +++ b/source/nmbd/nmbd.c @@ -468,7 +468,7 @@ static BOOL init_structs(void) */ /* Work out the max number of netbios aliases that we have */ ptr = lp_netbios_aliases(); - for( namecount=0; next_token(&ptr,nbname,NULL); namecount++ ) + for( namecount=0; next_token(&ptr,nbname,NULL, sizeof(nbname)); namecount++ ) ; if ( *global_myname ) namecount++; @@ -487,7 +487,7 @@ static BOOL init_structs(void) my_netbios_names[namecount++] = global_myname; ptr = lp_netbios_aliases(); - while ( next_token( &ptr, nbname, NULL ) ) + while ( next_token( &ptr, nbname, NULL, sizeof(nbname) ) ) { strupper( nbname ); /* Look for duplicates */ -- cgit