From 73935283dea4c05c18e2ee2d3606e450d052c60c Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Tue, 10 Jul 2018 14:44:35 +0000 Subject: Get rid of strcpy and strncpy (they were all looking safe though) --- greeter/greet.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'greeter/greet.c') diff --git a/greeter/greet.c b/greeter/greet.c index 6f17175..3802bb3 100644 --- a/greeter/greet.c +++ b/greeter/greet.c @@ -101,10 +101,8 @@ GreetDone ( data->name, strlen (data->passwd)); switch (status) { case NOTIFY_OK: - strncpy (name, data->name, sizeof(name)); - name[sizeof(name)-1] = '\0'; - strncpy (password, data->passwd, sizeof(password)); - password[sizeof(password)-1] = '\0'; + strlcpy (name, data->name, sizeof(name)); + strlcpy (password, data->passwd, sizeof(password)); code = 0; done = 1; break; -- cgit v1.2.3