summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-23 13:27:35 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-23 13:27:35 +0000
commit2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea (patch)
tree44885a8b68275050bed851eca36937f19317eb3e /source3/param
parent13b54b9cfad9519f63f35fa284ce1c82b73d656a (diff)
downloadsamba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.tar.gz
samba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.tar.bz2
samba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.zip
Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted
a pstrcpy/fstrcpy or at most a safe_strcpy(). These have the advantage of being compiler-verifiable. Get these out of the way, along with a rewrite of 'get_short_archi' in the spoolss client and server. (This pushes around const string pointers, rather than copied strings). Andrew Bartlett (This used to be commit 32fb801ddc035e8971e9911ed4b6e51892e9d1cc)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 0c0a50d7e4..94cfcbb47b 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1513,14 +1513,17 @@ static char *lp_string(const char *s)
if (!ret)
return NULL;
+ /* Note: safe_strcpy touches len+1 bytes, but we allocate 100
+ * extra bytes so we're OK. */
+
if (!s)
*ret = 0;
else
- StrnCpy(ret, s, len);
+ safe_strcpy(ret, s, len+99);
if (trim_string(ret, "\"", "\"")) {
if (strchr(ret,'"') != NULL)
- StrnCpy(ret, s, len);
+ safe_strcpy(ret, s, len+99);
}
standard_sub_basic(current_user_info.smb_name,ret,len+100);