summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-03-29 17:13:07 -0700
committerJeremy Allison <jra@samba.org>2012-03-30 21:26:07 +0200
commit959516d61bc6ee7cdd12409dde0ec00044208f1b (patch)
tree7639ccf8ba796ca775ff89b6e329d37f53a3ff9a /source3/utils
parent60eb1621d2c3224a2c7e8bec947741446ecbc4b1 (diff)
downloadsamba-959516d61bc6ee7cdd12409dde0ec00044208f1b.tar.gz
samba-959516d61bc6ee7cdd12409dde0ec00044208f1b.tar.bz2
samba-959516d61bc6ee7cdd12409dde0ec00044208f1b.zip
More strlcat/strlcpy truncate checks.
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 4aaf365a88..ad3f448c5e 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3765,8 +3765,12 @@ static NTSTATUS copy_fn(const char *mnt, struct file_info *f,
}
/* search below that directory */
- strlcpy(new_mask, dir, sizeof(new_mask));
- strlcat(new_mask, "\\*", sizeof(new_mask));
+ if (strlcpy(new_mask, dir, sizeof(new_mask)) >= sizeof(new_mask)) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ if (strlcat(new_mask, "\\*", sizeof(new_mask)) >= sizeof(new_mask)) {
+ return NT_STATUS_NO_MEMORY;
+ }
old_dir = local_state->cwd;
local_state->cwd = dir;
@@ -4807,7 +4811,9 @@ static bool get_user_tokens_from_file(FILE *f,
token = &((*tokens)[*num_tokens-1]);
- strlcpy(token->name, line, sizeof(token->name));
+ if (strlcpy(token->name, line, sizeof(token->name)) >= sizeof(token->name)) {
+ return false;
+ }
token->token.num_sids = 0;
token->token.sids = NULL;
continue;