summaryrefslogtreecommitdiffstats
path: root/source3/torture
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/torture
parent60eb1621d2c3224a2c7e8bec947741446ecbc4b1 (diff)
downloadsamba-959516d61bc6ee7cdd12409dde0ec00044208f1b.tar.gz
samba-959516d61bc6ee7cdd12409dde0ec00044208f1b.tar.xz
samba-959516d61bc6ee7cdd12409dde0ec00044208f1b.zip
More strlcat/strlcpy truncate checks.
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index e2a2744daec..b0c74e2f374 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -7338,8 +7338,14 @@ static bool run_shortname_test(int dummy)
goto out;
}
- strlcpy(fname, "\\shortname\\", sizeof(fname));
- strlcat(fname, "test .txt", sizeof(fname));
+ if (strlcpy(fname, "\\shortname\\", sizeof(fname)) >= sizeof(fname)) {
+ correct = false;
+ goto out;
+ }
+ if (strlcat(fname, "test .txt", sizeof(fname)) >= sizeof(fname)) {
+ correct = false;
+ goto out;
+ }
s.val = false;