summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-05-09 17:29:39 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-05-17 17:30:09 +0200
commitff7568daaeb19ff30f47f7f600ead247eaf4e826 (patch)
treecf2ec9f255a383009eac14ca7f54349ca1353e11 /source3/lib
parent7a00d90d668f53914ffe035c41a5e79e60b51521 (diff)
downloadsamba-ff7568daaeb19ff30f47f7f600ead247eaf4e826.tar.gz
s3:lib: Use memcpy() in escape_ldap_string()
../source3/lib/ldap_escape.c: In function ‘escape_ldap_string’: ../source3/lib/ldap_escape.c:79:4: error: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Werror=stringop-truncation] strncpy (p, sub, 3); ^~~~~~~~~~~~~~~~~~~ We concatenat and do not care about NUL-termination till the loop has finished. 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>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/ldap_escape.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/ldap_escape.c b/source3/lib/ldap_escape.c
index fa75dabcae6..0d2b8f5fe01 100644
--- a/source3/lib/ldap_escape.c
+++ b/source3/lib/ldap_escape.c
@@ -76,7 +76,7 @@ char *escape_ldap_string(TALLOC_CTX *mem_ctx, const char *s)
output = tmp;
p = &output[i];
- strncpy (p, sub, 3);
+ memcpy(p, sub, 3);
p += 3;
i += 3;