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/99cbc45288e9
branches:  trunk
changeset: 955670:99cbc45288e9
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 5dfc76f3d1b8 -r 99cbc45288e9 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