From: Jeremy Allison Date: Mon, 19 Nov 2007 20:02:11 +0000 (-0800) Subject: Back-port fix for bug found by kukks - Samba adding X-Git-Tag: samba-3.0.27a~7 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=62a1c825b2cd702cc439c5f07fa36386b2260052 Back-port fix for bug found by kukks - Samba adding non-initialized name to IP mapping. Jeremy. --- diff --git a/source/nmbd/nmbd_namelistdb.c b/source/nmbd/nmbd_namelistdb.c index d71eb5479a2..cda12885ef4 100644 --- a/source/nmbd/nmbd_namelistdb.c +++ b/source/nmbd/nmbd_namelistdb.c @@ -505,8 +505,12 @@ void add_samba_names_to_subnet( struct subnet_record *subrec ) return; } - for( bcast_subrecs = FIRST_SUBNET, i = 0; bcast_subrecs; bcast_subrecs = NEXT_SUBNET_EXCLUDING_UNICAST(bcast_subrecs), i++ ) + for( bcast_subrecs = FIRST_SUBNET, i = 0; bcast_subrecs && + i < num_ips; + bcast_subrecs = NEXT_SUBNET_EXCLUDING_UNICAST(bcast_subrecs), i++ ) { iplist[i] = bcast_subrecs->myip; + } + num_ips = i; } add_name_to_subnet(subrec,"*",0x0,samba_nb_type, PERMANENT_TTL,