Module Name:    src
Committed By:   kamil
Date:           Tue Oct  6 22:04:09 UTC 2020

Modified Files:
        src/external/gpl3/gdb/dist/gdbsupport: agent.cc

Log Message:
Replace local patch with fix from upstream

Cherry-pick:

>From e2a2a24a8e78427ff8667d625f5befbe88c328bb Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski <[email protected]>
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdbsupport/agent.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdbsupport/agent.cc
diff -u src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.2 src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.3
--- src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.2	Sun Sep 20 21:18:45 2020
+++ src/external/gpl3/gdb/dist/gdbsupport/agent.cc	Tue Oct  6 22:04:09 2020
@@ -138,7 +138,7 @@ static int
 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 @@ gdb_connect_sync_socket (int pid)
       return -1;
     }
 
-  memset(&addr, 0, sizeof(addr));
   addr.sun_family = AF_UNIX;
 
   res = xsnprintf (addr.sun_path, UNIX_PATH_MAX, "%s", path);

Reply via email to