From 959516d61bc6ee7cdd12409dde0ec00044208f1b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 29 Mar 2012 17:13:07 -0700 Subject: More strlcat/strlcpy truncate checks. --- source3/torture/torture.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/torture') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index e2a2744dae..b0c74e2f37 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; -- cgit