about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-15 08:04:19 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-15 08:04:19 +0000
commit6beaac4da9692dbf24e86f6fd8fca4bbd6ccb90b (patch)
tree1250de9a2392b945e856bc232c39ed70333793be
parent0ff0d59e19b1a7db39f6d4e897a8bde0583a7c47 (diff)
downloadglibc-6beaac4da9692dbf24e86f6fd8fca4bbd6ccb90b.tar.gz
glibc-6beaac4da9692dbf24e86f6fd8fca4bbd6ccb90b.tar.xz
glibc-6beaac4da9692dbf24e86f6fd8fca4bbd6ccb90b.zip
Update.
1998-09-15 08:00  Ulrich Drepper  <drepper@cygnus.com>

	* nscd/pwdcache.c (save_pwd): Correct copying.
	* nscd/grpcache.c (save_grp): Likewise.
-rw-r--r--ChangeLog5
-rw-r--r--nscd/grpcache.c6
-rw-r--r--nscd/pwdcache.c8
3 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ff11b04c2..a61dac11fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
 	* nscd/pwdcache.c (save_pwd): Rewrite to use only one malloc call.
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index a5130075ad..beffa1e4a8 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -152,16 +152,16 @@ save_grp (struct group *src)
   cp = (char *) (dest->gr_mem + l + 1);
 
   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;
-  cp = mempcpy (cp, src->gr_passwd, passwd_len);
+  cp = mempcpy (cp, src->gr_passwd, passwd_len) + 1;
   dest->gr_gid = src->gr_gid;
 
   l = 0;
   while (src->gr_mem[l] != NULL)
     {
       dest->gr_mem[l] = cp;
-      cp = stpcpy (cp, src->gr_mem[l]);
+      cp = stpcpy (cp, src->gr_mem[l]) + 1;
       ++l;
     }
   dest->gr_mem[l] = NULL;
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c
index 85b4fe9bde..12d18ddacc 100644
--- a/nscd/pwdcache.c
+++ b/nscd/pwdcache.c
@@ -146,15 +146,15 @@ save_pwd (struct passwd *src)
 
   cp = (char *) (dest + 1);
   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;
-  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_gid = src->pw_gid;
   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;
-  cp = mempcpy (cp, src->pw_dir, dir_len);
+  cp = mempcpy (cp, src->pw_dir, dir_len) + 1;
   dest->pw_shell = cp;
   mempcpy (cp, src->pw_shell, shell_len);