summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_afsacl.c
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/modules/vfs_afsacl.c
parent60eb1621d2c3224a2c7e8bec947741446ecbc4b1 (diff)
downloadsamba-959516d61bc6ee7cdd12409dde0ec00044208f1b.tar.gz
samba-959516d61bc6ee7cdd12409dde0ec00044208f1b.tar.bz2
samba-959516d61bc6ee7cdd12409dde0ec00044208f1b.zip
More strlcat/strlcpy truncate checks.
Diffstat (limited to 'source3/modules/vfs_afsacl.c')
-rw-r--r--source3/modules/vfs_afsacl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c
index e965e4c8b1..61a31458cf 100644
--- a/source3/modules/vfs_afsacl.c
+++ b/source3/modules/vfs_afsacl.c
@@ -316,16 +316,22 @@ static bool unparse_afs_acl(struct afs_acl *acl, char *acl_str)
}
fstr_sprintf(line, "%d\n", positives);
- strlcat(acl_str, line, MAXSIZE);
+ if (strlcat(acl_str, line, MAXSIZE) >= MAXSIZE) {
+ return false;
+ }
fstr_sprintf(line, "%d\n", negatives);
- strlcat(acl_str, line, MAXSIZE);
+ if (strlcat(acl_str, line, MAXSIZE) >= MAXSIZE) {
+ return false;
+ }
ace = acl->acelist;
while (ace != NULL) {
fstr_sprintf(line, "%s\t%d\n", ace->name, ace->rights);
- strlcat(acl_str, line, MAXSIZE);
+ if (strlcat(acl_str, line, MAXSIZE) >= MAXSIZE) {
+ return false;
+ }
ace = ace->next;
}
return true;