mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-20 17:51:16 +00:00
Update.
1998-09-15 08:00 Ulrich Drepper <drepper@cygnus.com> * nscd/pwdcache.c (save_pwd): Correct copying. * nscd/grpcache.c (save_grp): Likewise.
This commit is contained in:
parent
0ff0d59e19
commit
6beaac4da9
@ -1,3 +1,8 @@
|
|||||||
|
1998-09-15 08:00 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* nscd/pwdcache.c (save_pwd): Correct copying.
|
||||||
|
* nscd/grpcache.c (save_grp): Likewise.
|
||||||
|
|
||||||
1998-09-14 23:36 Ulrich Drepper <drepper@cygnus.com>
|
1998-09-14 23:36 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* nscd/pwdcache.c (save_pwd): Rewrite to use only one malloc call.
|
* nscd/pwdcache.c (save_pwd): Rewrite to use only one malloc call.
|
||||||
|
@ -152,16 +152,16 @@ save_grp (struct group *src)
|
|||||||
cp = (char *) (dest->gr_mem + l + 1);
|
cp = (char *) (dest->gr_mem + l + 1);
|
||||||
|
|
||||||
dest->gr_name = cp;
|
dest->gr_name = cp;
|
||||||
cp = mempcpy (cp, src->gr_name, name_len);
|
cp = mempcpy (cp, src->gr_name, name_len) + 1;
|
||||||
dest->gr_passwd = cp;
|
dest->gr_passwd = cp;
|
||||||
cp = mempcpy (cp, src->gr_passwd, passwd_len);
|
cp = mempcpy (cp, src->gr_passwd, passwd_len) + 1;
|
||||||
dest->gr_gid = src->gr_gid;
|
dest->gr_gid = src->gr_gid;
|
||||||
|
|
||||||
l = 0;
|
l = 0;
|
||||||
while (src->gr_mem[l] != NULL)
|
while (src->gr_mem[l] != NULL)
|
||||||
{
|
{
|
||||||
dest->gr_mem[l] = cp;
|
dest->gr_mem[l] = cp;
|
||||||
cp = stpcpy (cp, src->gr_mem[l]);
|
cp = stpcpy (cp, src->gr_mem[l]) + 1;
|
||||||
++l;
|
++l;
|
||||||
}
|
}
|
||||||
dest->gr_mem[l] = NULL;
|
dest->gr_mem[l] = NULL;
|
||||||
|
@ -146,15 +146,15 @@ save_pwd (struct passwd *src)
|
|||||||
|
|
||||||
cp = (char *) (dest + 1);
|
cp = (char *) (dest + 1);
|
||||||
dest->pw_name = cp;
|
dest->pw_name = cp;
|
||||||
cp = mempcpy (cp, src->pw_name, name_len);
|
cp = mempcpy (cp, src->pw_name, name_len) + 1;
|
||||||
dest->pw_passwd = cp;
|
dest->pw_passwd = cp;
|
||||||
cp = mempcpy (cp, src->pw_passwd, passwd_len);
|
cp = mempcpy (cp, src->pw_passwd, passwd_len) + 1;
|
||||||
dest->pw_uid = src->pw_uid;
|
dest->pw_uid = src->pw_uid;
|
||||||
dest->pw_gid = src->pw_gid;
|
dest->pw_gid = src->pw_gid;
|
||||||
dest->pw_gecos = cp;
|
dest->pw_gecos = cp;
|
||||||
cp = mempcpy (cp, src->pw_gecos, gecos_len);
|
cp = mempcpy (cp, src->pw_gecos, gecos_len) + 1;
|
||||||
dest->pw_dir = cp;
|
dest->pw_dir = cp;
|
||||||
cp = mempcpy (cp, src->pw_dir, dir_len);
|
cp = mempcpy (cp, src->pw_dir, dir_len) + 1;
|
||||||
dest->pw_shell = cp;
|
dest->pw_shell = cp;
|
||||||
mempcpy (cp, src->pw_shell, shell_len);
|
mempcpy (cp, src->pw_shell, shell_len);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user