diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-03-06 07:55:48 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-03-06 07:55:48 +0000 |
commit | 192148bab352697e625e78e7f2444e00453f35ff (patch) | |
tree | dfe53aeadc911f961ee146cb5af7ba6d1f370246 /source3/utils | |
parent | 7a3cc345e0508848b0e2bd492789973bcf2d5841 (diff) | |
download | samba-192148bab352697e625e78e7f2444e00453f35ff.tar.gz samba-192148bab352697e625e78e7f2444e00453f35ff.tar.bz2 samba-192148bab352697e625e78e7f2444e00453f35ff.zip |
More safe_strcpy() off-by-one bug fixes. (mostly moves to pstrcpy()/fstrcpy())
Andrew Bartlett
(This used to be commit 42b5514404bc7e33306c11344c6c934a1f83d295)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net.c | 2 | ||||
-rw-r--r-- | source3/utils/net_rap.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c index c1285bc64b..f6b3c5c84c 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -241,7 +241,7 @@ BOOL net_find_dc(struct in_addr *server_ip, fstring server_name, const char *dom if (!lookup_dc_name(global_myname(), domain_name, server_ip, dc_name)) return False; - safe_strcpy(server_name, dc_name, FSTRING_LEN); + fstrcpy(server_name, dc_name); return True; } else return False; diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c index 8f3dd53fa6..f52eabf494 100644 --- a/source3/utils/net_rap.c +++ b/source3/utils/net_rap.c @@ -638,7 +638,7 @@ static int rap_user_add(int argc, const char **argv) if (!(cli = net_make_ipc_connection(0))) return -1; - safe_strcpy(userinfo.user_name, argv[0], sizeof(userinfo.user_name)); + safe_strcpy(userinfo.user_name, argv[0], sizeof(userinfo.user_name)-1); if (opt_flags == -1) opt_flags = 0x21; @@ -755,7 +755,7 @@ static int rap_group_add(int argc, const char **argv) return -1; /* BB check for length 21 or smaller explicitly ? BB */ - safe_strcpy(grinfo.group_name, argv[0], sizeof(grinfo.group_name)); + safe_strcpy(grinfo.group_name, argv[0], sizeof(grinfo.group_name)-1); grinfo.reserved1 = '\0'; grinfo.comment = smb_xstrdup(opt_comment); |