about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-02-16 06:34:26 +0000
committerUlrich Drepper <drepper@redhat.com>2007-02-16 06:34:26 +0000
commit6eea8e0d4838c05e0be24620baa05f00a014fffa (patch)
tree51711eadf962b4136587ec9fc5b3d0db803d2ea9
parent987f54c67c86bbb43e8d88fcaf914bdb5b3dc846 (diff)
downloadglibc-6eea8e0d4838c05e0be24620baa05f00a014fffa.tar.gz
glibc-6eea8e0d4838c05e0be24620baa05f00a014fffa.tar.xz
glibc-6eea8e0d4838c05e0be24620baa05f00a014fffa.zip
* nscd/nscd_helper.c (open_socket): Don't send padding bytes from
	reqdata.
-rw-r--r--ChangeLog3
-rw-r--r--nscd/nscd_helper.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0398349185..d190358ff9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-02-15  Ulrich Drepper  <drepper@redhat.com>
 
+	* nscd/nscd_helper.c (open_socket): Don't send padding bytes from
+	reqdata.
+
 	* sysdeps/unix/sysv/linux/x86_64/send.c (__libc_send): Cosmetic
 	change: don't pass NULL in place of an integer.
 
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c
index 577c6a052a..1f56ccf6aa 100644
--- a/nscd/nscd_helper.c
+++ b/nscd/nscd_helper.c
@@ -108,6 +108,7 @@ open_socket (request_type type, const char *key, size_t keylen)
     request_header req;
     char key[keylen];
   } reqdata;
+  size_t real_sizeof_reqdata = sizeof (request_header) + keylen;
 
   /* Make socket non-blocking.  */
   __fcntl (sock, F_SETFL, O_RDWR | O_NONBLOCK);
@@ -135,9 +136,9 @@ open_socket (request_type type, const char *key, size_t keylen)
 # define MSG_NOSIGNAL 0
 #endif
       ssize_t wres = TEMP_FAILURE_RETRY (__send (sock, &reqdata,
-						 sizeof (reqdata),
+						 real_sizeof_reqdata,
 						 MSG_NOSIGNAL));
-      if (__builtin_expect (wres == (ssize_t) sizeof (reqdata), 1))
+      if (__builtin_expect (wres == (ssize_t) real_sizeof_reqdata, 1))
 	/* We managed to send the request.  */
 	return sock;