summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-05-04 11:38:26 -0700
committerJeremy Allison <jra@samba.org>2011-05-04 12:12:15 -0700
commit8380835fc6de38706d9af29dc7f0fa4cec4f9c90 (patch)
tree5fdf238d5573c022a135e3f2e5590b656b0d64bf /source3/nmbd
parentdf023b8657cab232df88d3656aa5d87676bb7254 (diff)
downloadsamba-8380835fc6de38706d9af29dc7f0fa4cec4f9c90.tar.gz
samba-8380835fc6de38706d9af29dc7f0fa4cec4f9c90.tar.bz2
samba-8380835fc6de38706d9af29dc7f0fa4cec4f9c90.zip
Fix warning messages caused by addition of null check in fstrcpy macro.
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd_browsesync.c6
-rw-r--r--source3/nmbd/nmbd_incomingdgrams.c6
-rw-r--r--source3/nmbd/nmbd_workgroupdb.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c
index 4a6f9f2d47..1a262e4728 100644
--- a/source3/nmbd/nmbd_browsesync.c
+++ b/source3/nmbd/nmbd_browsesync.c
@@ -435,7 +435,7 @@ static void get_domain_master_name_node_status_success(struct subnet_record *sub
if(!(nb_flags & NB_GROUP) && (name_type == 0x00) &&
server_name[0] == 0) {
/* this is almost certainly the server netbios name */
- unstrcpy(server_name, qname);
+ strlcpy(server_name, qname, sizeof(server_name));
continue;
}
@@ -461,7 +461,9 @@ static void get_domain_master_name_node_status_success(struct subnet_record *sub
return;
/* remember who the master is */
- unstrcpy(work->local_master_browser_name, server_name);
+ strlcpy(work->local_master_browser_name,
+ server_name,
+ sizeof(work->local_master_browser_name));
make_nmb_name(&nmbname, server_name, 0x20);
work->dmb_name = nmbname;
work->dmb_addr = from_ip;
diff --git a/source3/nmbd/nmbd_incomingdgrams.c b/source3/nmbd/nmbd_incomingdgrams.c
index 6993e18358..d3b9d3d439 100644
--- a/source3/nmbd/nmbd_incomingdgrams.c
+++ b/source3/nmbd/nmbd_incomingdgrams.c
@@ -172,7 +172,7 @@ void process_host_announce(struct subnet_record *subrec, struct packet_struct *p
/* Update the record. */
servrec->serv.type = servertype|SV_TYPE_LOCAL_LIST_ONLY;
update_server_ttl( servrec, ttl);
- fstrcpy(servrec->serv.comment,comment);
+ strlcpy(servrec->serv.comment,comment,sizeof(servrec->serv.comment));
}
} else {
/*
@@ -338,7 +338,7 @@ a local master browser for workgroup %s and we think we are master. Forcing elec
/* Update the record. */
servrec->serv.type = servertype|SV_TYPE_LOCAL_LIST_ONLY;
update_server_ttl(servrec, ttl);
- fstrcpy(servrec->serv.comment,comment);
+ strlcpy(servrec->serv.comment,comment,sizeof(servrec->serv.comment));
}
set_workgroup_local_master_browser_name( work, server_name );
@@ -512,7 +512,7 @@ originate from OS/2 Warp client. Ignoring packet.\n"));
/* Update the record. */
servrec->serv.type = servertype|SV_TYPE_LOCAL_LIST_ONLY;
update_server_ttl( servrec, ttl);
- fstrcpy(servrec->serv.comment,comment);
+ strlcpy(servrec->serv.comment,comment,sizeof(servrec->serv.comment));
}
} else {
/*
diff --git a/source3/nmbd/nmbd_workgroupdb.c b/source3/nmbd/nmbd_workgroupdb.c
index 5ce10e64d4..819d5048ad 100644
--- a/source3/nmbd/nmbd_workgroupdb.c
+++ b/source3/nmbd/nmbd_workgroupdb.c
@@ -52,7 +52,7 @@ static void name_to_unstring(unstring unname, const char *name)
if (errno == E2BIG) {
unstring tname;
pull_ascii_nstring(tname, sizeof(tname), nname);
- unstrcpy(unname, tname);
+ strlcpy(unname, tname, sizeof(nname));
DEBUG(0,("name_to_nstring: workgroup name %s is too long. Truncating to %s\n",
name, tname));
} else {