Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb/dist/gdbsupport Replace local patch with f...



details:   https://anonhg.NetBSD.org/src/rev/72e25efbfb16
branches:  trunk
changeset: 1014929:72e25efbfb16
user:      kamil <kamil%NetBSD.org@localhost>
date:      Tue Oct 06 22:04:09 2020 +0000

description:
Replace local patch with fix from upstream

Cherry-pick:

>From e2a2a24a8e78427ff8667d625f5befbe88c328bb Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski <n54%gmx.com@localhost>
Date: Wed, 23 Sep 2020 04:20:05 +0200
Subject: [PATCH] Preinitialize the sockaddr_un variable to zero

Don't pass random sun_len for the BSD's,
zero the whole structure as recommended for portability.

Reported by Coverity.

gdbsupport/ChangeLog:

        * agent.cc (gdb_connect_sync_socket): Preinitialize addr with zeros.

diffstat:

 external/gpl3/gdb/dist/gdbsupport/agent.cc |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 6b442a8480c3 -r 72e25efbfb16 external/gpl3/gdb/dist/gdbsupport/agent.cc
--- a/external/gpl3/gdb/dist/gdbsupport/agent.cc        Tue Oct 06 21:54:01 2020 +0000
+++ b/external/gpl3/gdb/dist/gdbsupport/agent.cc        Tue Oct 06 22:04:09 2020 +0000
@@ -138,7 +138,7 @@
 gdb_connect_sync_socket (int pid)
 {
 #ifdef HAVE_SYS_UN_H
-  struct sockaddr_un addr;
+  struct sockaddr_un addr = {};
   int res, fd;
   char path[UNIX_PATH_MAX];
 
@@ -153,7 +153,6 @@
       return -1;
     }
 
-  memset(&addr, 0, sizeof(addr));
   addr.sun_family = AF_UNIX;
 
   res = xsnprintf (addr.sun_path, UNIX_PATH_MAX, "%s", path);



Home | Main Index | Thread Index | Old Index