diff options
author | Jeremy Allison <jra@samba.org> | 1997-09-16 17:40:17 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1997-09-16 17:40:17 +0000 |
commit | 6449fc3b22284cea0aa186b0c6468696a1d8c1b4 (patch) | |
tree | 1d163f79ab86aab8cd0b10c24d46de6c22627978 | |
parent | 6ce9192fc23d1e9e3fba80f774ff8d56f7736ee1 (diff) | |
download | samba-6449fc3b22284cea0aa186b0c6468696a1d8c1b4.tar.gz samba-6449fc3b22284cea0aa186b0c6468696a1d8c1b4.tar.bz2 samba-6449fc3b22284cea0aa186b0c6468696a1d8c1b4.zip |
Fixing assumtions that malloced memory is zero filled - making
sure it is.
Jeremy (jallison@whistle.com)
(This used to be commit 59ee0d0c7ea166a3bf58ceb4c939217d6ff74498)
-rw-r--r-- | source3/namedbname.c | 2 | ||||
-rw-r--r-- | source3/namedbresp.c | 2 | ||||
-rw-r--r-- | source3/namedbwork.c | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/source3/namedbname.c b/source3/namedbname.c index c91541cc81..a45a749f14 100644 --- a/source3/namedbname.c +++ b/source3/namedbname.c @@ -486,6 +486,8 @@ struct name_record *add_netbios_entry(struct subnet_record *d, return NULL; } + bzero((char *)n->ip_flgs, sizeof(*n->ip_flgs) * n->num_ips); + make_nmb_name(&n->name,name,type,scope); if ((n2 = find_name_search(&found_subnet, &n->name, search, new_only?ipzero:ip))) diff --git a/source3/namedbresp.c b/source3/namedbresp.c index 98f8ca774b..86d7eddbd4 100644 --- a/source3/namedbresp.c +++ b/source3/namedbresp.c @@ -104,6 +104,8 @@ struct response_record *make_response_queue_record(enum state_type state, if (!(n = (struct response_record *)malloc(sizeof(*n)))) return(NULL); + bzero((char *)n, sizeof(*n)); + n->response_id = id; n->state = state; n->fd = fd; diff --git a/source3/namedbwork.c b/source3/namedbwork.c index 2982ffd3e7..a6260aab46 100644 --- a/source3/namedbwork.c +++ b/source3/namedbwork.c @@ -84,7 +84,8 @@ static struct work_record *make_workgroup(char *name) work = (struct work_record *)malloc(sizeof(*work)); if (!work) return(NULL); - + bzero((char *)work, sizeof(*work)); + StrnCpy(work->work_group,name,sizeof(work->work_group)-1); work->serverlist = NULL; @@ -92,6 +93,7 @@ static struct work_record *make_workgroup(char *name) SV_TYPE_POTENTIAL_BROWSER : 0 ); work->RunningElection = False; work->ElectionCount = 0; + work->announce_interval = 0; work->needelection = False; work->needannounce = True; work->mst_state = MST_POTENTIAL; |