diff options
Diffstat (limited to 'src/nss-systemd')
-rw-r--r-- | src/nss-systemd/nss-systemd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c index 1840a0d508..7aea3652c4 100644 --- a/src/nss-systemd/nss-systemd.c +++ b/src/nss-systemd/nss-systemd.c @@ -236,7 +236,7 @@ static enum nss_status copy_synthesized_group( required = strlen(src->gr_name) + 1; required += strlen(src->gr_passwd) + 1; - required += 1; /* ...but that NULL still needs to be stored into the buffer! */ + required += sizeof(char*); /* ...but that NULL still needs to be stored into the buffer! */ if (buflen < required) { *errnop = ERANGE; @@ -250,7 +250,7 @@ static enum nss_status copy_synthesized_group( /* String fields point into the user-provided buffer */ dest->gr_name = buffer; dest->gr_passwd = stpcpy(dest->gr_name, src->gr_name) + 1; - dest->gr_mem = (char **) strcpy(dest->gr_passwd, src->gr_passwd) + 1; + dest->gr_mem = (char **) stpcpy(dest->gr_passwd, src->gr_passwd) + 1; *dest->gr_mem = NULL; return NSS_STATUS_SUCCESS; |