summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-05-09 17:35:45 +0200
committerKarolin Seeger <kseeger@samba.org>2018-06-20 09:22:24 +0200
commit3ef6d6ab6dc1d8f220d0d9e3c8e47af682f3e115 (patch)
tree32ab31fcb1b3ee642104c13cd30a04e76c68c55f /source4/torture/basic
parentc16e479f49f5bf010f61a923435ca16393747340 (diff)
downloadsamba-3ef6d6ab6dc1d8f220d0d9e3c8e47af682f3e115.tar.gz
s4:torture: Use strlcpy() in gen_name()
../source4/torture/basic/mangle_test.c: In function ‘gen_name’: ../source4/torture/basic/mangle_test.c:148:3: error: ‘strncpy’ output truncated before terminating nul copying 5 bytes from a string of the same length [-Werror=stringop-truncation] strncpy(p, "ABCDE", 5); ^~~~~~~~~~~~~~~~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit 7a00d90d668f53914ffe035c41a5e79e60b51521)
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/mangle_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/torture/basic/mangle_test.c b/source4/torture/basic/mangle_test.c
index 0b7d696e677..df12b3ce821 100644
--- a/source4/torture/basic/mangle_test.c
+++ b/source4/torture/basic/mangle_test.c
@@ -145,7 +145,7 @@ static char *gen_name(TALLOC_CTX *mem_ctx)
/* and a medium probability of a common lead string */
if ((len > 5) && (random() % 10 == 0)) {
- strncpy(p, "ABCDE", 5);
+ strlcpy(p, "ABCDE", 6);
}
/* and a high probability of a good extension length */