From: Christian Biesinger Date: Sat, 2 Nov 2019 18:16:09 +0000 (-0500) Subject: Use getpwuid_r instead of getpwuid X-Git-Tag: gdb-9-branchpoint~317 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b7b9424d3f94ba5595c4e164b67c0f621146dfe;p=thirdparty%2Fbinutils-gdb.git Use getpwuid_r instead of getpwuid gdb/ChangeLog: 2019-11-11 Christian Biesinger * nat/linux-osdata.c (user_from_uid): Use getpwuid_r. Change-Id: I587359267f8963ef1da6ba0223a1525807a721de --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dd280ec5cc4..edd3e9013b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-11-11 Christian Biesinger + + * nat/linux-osdata.c (user_from_uid): Use getpwuid_r. + 2019-11-10 Andrew Burgess * python/py-symbol.c (gdbpy_lookup_static_symbols): New diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c index 84357e29559..ca6acd39eb1 100644 --- a/gdb/nat/linux-osdata.c +++ b/gdb/nat/linux-osdata.c @@ -205,7 +205,10 @@ commandline_from_pid (PID_T pid) static void user_from_uid (char *user, int maxlen, uid_t uid) { - struct passwd *pwentry = getpwuid (uid); + struct passwd *pwentry; + char buf[1024]; + struct passwd pwd; + getpwuid_r (uid, &pwd, buf, sizeof (buf), &pwentry); if (pwentry) {