about summary refs log tree commit diff
path: root/gshadow/sgetsgent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-23 22:52:24 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-23 22:52:24 +0000
commit7f8a28efb5c9bf19d3a31a7f356cc171f333ceef (patch)
tree03175c4a76429b3f571b81770394ae731732711e /gshadow/sgetsgent_r.c
parentc7e74e5968929264fca40424f979653115643f5d (diff)
downloadglibc-7f8a28efb5c9bf19d3a31a7f356cc171f333ceef.tar.gz
glibc-7f8a28efb5c9bf19d3a31a7f356cc171f333ceef.tar.xz
glibc-7f8a28efb5c9bf19d3a31a7f356cc171f333ceef.zip
* sysdeps/unix/sysv/linux/preadv.c: The kernel API changed. Adjust.
	* sysdeps/unix/sysv/linux/pwritev.c: Likewise.

2009-04-23  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/pwritev.c (PWRITEV): Fix up comment.  Copy
	data from vector to temporary buffer and call PWRITEV after it
	instead of vice versa.
	* sysdeps/posix/preadv.c: Fix up comment.
	* misc/preadv.c: Likewise.
	* misc/preadv64.c: Likewise.
	* misc/pwritev.c: Likewise.
	* misc/pwritev64.c: Likewise.
	* misc/sys/uio.h (preadv, pwritev, preadv64, pwritev64): Likewise.

2009-04-23  Ulrich Drepper  <drepper@redhat.com>
Diffstat (limited to 'gshadow/sgetsgent_r.c')
-rw-r--r--gshadow/sgetsgent_r.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gshadow/sgetsgent_r.c b/gshadow/sgetsgent_r.c
index 72c51fe26b..2292719af9 100644
--- a/gshadow/sgetsgent_r.c
+++ b/gshadow/sgetsgent_r.c
@@ -58,7 +58,12 @@ __sgetsgent_r (const char *string, struct sgrp *resbuf, char *buffer,
 {
   char *sp;
   if (string < buffer || string >= buffer + buflen)
-    sp = strncpy (buffer, string, buflen);
+    {
+      buffer[buflen - 1] = '\0';
+      sp = strncpy (buffer, string, buflen);
+      if (buffer[buflen - 1] != '\0')
+	return ERANGE;
+    }
   else
     sp = (char *) string;