summaryrefslogtreecommitdiff
path: root/source3/utils/net_rap.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-03-18 11:22:52 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-03-18 11:22:52 +0000
commitd5ee9b2f480ddbda0b8f69409698d27c99384f9c (patch)
tree2664e91ce8bbfedeaf34292fca1d5dcfb8039176 /source3/utils/net_rap.c
parent5452ecebc7d89fac6e1047b92b77be47fe85914c (diff)
downloadsamba-d5ee9b2f480ddbda0b8f69409698d27c99384f9c.tar.gz
samba-d5ee9b2f480ddbda0b8f69409698d27c99384f9c.tar.bz2
samba-d5ee9b2f480ddbda0b8f69409698d27c99384f9c.zip
Jeremy merged across my string parinoia fixes, but forgot to enable them! :-)
This patch catches up on the rest of the work - as much string checking as is possible is done at compile time, and the rest at runtime. Lots of code converted to pstrcpy() etc, and other code reworked to correctly call sizeof(). Andrew Bartlett (This used to be commit c5b604e2ee67d74241ae2fa07ae904647d35a2be)
Diffstat (limited to 'source3/utils/net_rap.c')
-rw-r--r--source3/utils/net_rap.c4
1 files changed, 2 insertions, 2 deletions
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);