s3:lib: Use memcpy() in escape_ldap_string()
commit992faaaffe6ed495cb88da5fe9669f82dbc59357
authorAndreas Schneider <asn@samba.org>
Wed, 9 May 2018 15:29:39 +0000 (9 17:29 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 27 Jun 2018 08:34:21 +0000 (27 10:34 +0200)
tree28904b8c281aa6ca0e48344edc82ce24c96d0066
parent7cf1573dec15fa806cf3b5265a86f74d8a1d77cc
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>
(cherry picked from commit ff7568daaeb19ff30f47f7f600ead247eaf4e826)
source3/lib/ldap_escape.c