This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch release/2.26/master updated. glibc-2.26-147-g7e7a5f0


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.26/master has been updated
       via  7e7a5f0bcd28c6fc5285474f05080ac6ed5e55b9 (commit)
      from  d300041c533a3d837c9f37a099bcc95466860e98 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7e7a5f0bcd28c6fc5285474f05080ac6ed5e55b9

commit 7e7a5f0bcd28c6fc5285474f05080ac6ed5e55b9
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu May 17 13:54:45 2018 +0200

    resolv: Fully initialize struct mmsghdr in send_dg [BZ #23037]
    
    (cherry picked from commit 583a27d525ae189bdfaa6784021b92a9a1dae12e)

diff --git a/ChangeLog b/ChangeLog
index 60755b9..8c1ff9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-09  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #23037]
+	* resolv/res_send.c (send_dg): Use designated initializers instead
+	of assignment to zero-initialize other fields of struct mmsghdr.
+
 2018-01-18  Arjun Shankar  <arjun@redhat.com>
 
 	[BZ #22343]
diff --git a/NEWS b/NEWS
index 410f0d1..8c432b3 100644
--- a/NEWS
+++ b/NEWS
@@ -118,6 +118,7 @@ The following bugs are resolved with this release:
   [22685] powerpc: Fix syscalls during early process initialization
   [22715] x86-64: Properly align La_x86_64_retval to VEC_SIZE
   [22774] malloc: Integer overflow in malloc (CVE-2018-6551)
+  [23037] resolv: Fully initialize struct mmsghdr in send_dg
 
 Version 2.26
 
diff --git a/resolv/res_send.c b/resolv/res_send.c
index b396aae..0ca02f9 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -1152,25 +1152,27 @@ send_dg(res_state statp,
 		if (have_sendmmsg >= 0 && nwritten == 0 && buf2 != NULL
 		    && !single_request)
 		  {
-		    struct iovec iov[2];
-		    struct mmsghdr reqs[2];
-		    reqs[0].msg_hdr.msg_name = NULL;
-		    reqs[0].msg_hdr.msg_namelen = 0;
-		    reqs[0].msg_hdr.msg_iov = &iov[0];
-		    reqs[0].msg_hdr.msg_iovlen = 1;
-		    iov[0].iov_base = (void *) buf;
-		    iov[0].iov_len = buflen;
-		    reqs[0].msg_hdr.msg_control = NULL;
-		    reqs[0].msg_hdr.msg_controllen = 0;
-
-		    reqs[1].msg_hdr.msg_name = NULL;
-		    reqs[1].msg_hdr.msg_namelen = 0;
-		    reqs[1].msg_hdr.msg_iov = &iov[1];
-		    reqs[1].msg_hdr.msg_iovlen = 1;
-		    iov[1].iov_base = (void *) buf2;
-		    iov[1].iov_len = buflen2;
-		    reqs[1].msg_hdr.msg_control = NULL;
-		    reqs[1].msg_hdr.msg_controllen = 0;
+		    struct iovec iov =
+		      { .iov_base = (void *) buf, .iov_len = buflen };
+		    struct iovec iov2 =
+		      { .iov_base = (void *) buf2, .iov_len = buflen2 };
+		    struct mmsghdr reqs[2] =
+		      {
+			{
+			  .msg_hdr =
+			    {
+			      .msg_iov = &iov,
+			      .msg_iovlen = 1,
+			    },
+			},
+			{
+			  .msg_hdr =
+			    {
+			      .msg_iov = &iov2,
+			      .msg_iovlen = 1,
+			    }
+			},
+		      };
 
 		    int ndg = __sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
 		    if (__glibc_likely (ndg == 2))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    6 ++++++
 NEWS              |    1 +
 resolv/res_send.c |   40 +++++++++++++++++++++-------------------
 3 files changed, 28 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]