summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-28 00:05:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:01 -0500
commitd70803ebe3472cc1930e5732b320d14a47c54d28 (patch)
treebc0d4896c6cef5c731336832ed2744b568a311d1 /source3/nmbd
parent9a7adde8a37a5593e8fbb2bdfd5003c837d568ed (diff)
downloadsamba-d70803ebe3472cc1930e5732b320d14a47c54d28.tar.gz
samba-d70803ebe3472cc1930e5732b320d14a47c54d28.tar.bz2
samba-d70803ebe3472cc1930e5732b320d14a47c54d28.zip
r16579: Fix Klocwork #2016. Possible null deref.
Jeremy. (This used to be commit f6d5bae4a105eee1b1d5b1aaa70a675705345d9e)
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd_serverlistdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd_serverlistdb.c b/source3/nmbd/nmbd_serverlistdb.c
index cc762ae8d2..ea27f9d4e5 100644
--- a/source3/nmbd/nmbd_serverlistdb.c
+++ b/source3/nmbd/nmbd_serverlistdb.c
@@ -214,7 +214,7 @@ static uint32 write_this_server_name( struct subnet_record *subrec,
struct work_record *iwork;
/* Go through all the subnets we have already seen. */
- for (ssub = FIRST_SUBNET; ssub != subrec; ssub = NEXT_SUBNET_INCLUDING_UNICAST(ssub)) {
+ for (ssub = FIRST_SUBNET; ssub && (ssub != subrec); ssub = NEXT_SUBNET_INCLUDING_UNICAST(ssub)) {
for(iwork = ssub->workgrouplist; iwork; iwork = iwork->next) {
if(find_server_in_workgroup( iwork, servrec->serv.name) != NULL) {
/*