1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

lib:tdb: Remove use of strcpy in tdb test.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Jeremy Allison 2016-03-16 13:55:31 -07:00 committed by Martin Schwenke
parent 4609058a9c
commit a559ac31f7

View File

@ -184,7 +184,8 @@ enum agent_return external_agent_operation(struct agent *agent,
string = malloc(len);
string[0] = op;
strcpy(string+1, name);
strncpy(string+1, name, len - 1);
string[len-1] = '\0';
if (write(agent->cmdfd, string, len) != len
|| read(agent->responsefd, &res, sizeof(res)) != sizeof(res))