]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Don't return stale data from fbsd_pid_to_exec_file for kernel processes.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 9 Jan 2018 21:35:17 +0000 (13:35 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 9 Jan 2018 21:35:17 +0000 (13:35 -0800)
commitb999e2038dbc54e2c8b1c390f8b8fe50d0f1d10a
tree611e13c2ebffc3ec8d90218c327f231bb73a1812
parentd2176225dc982c22640215a0e611e997e8eeb030
Don't return stale data from fbsd_pid_to_exec_file for kernel processes.

For processes without an associated executable (such as kernel processes),
the kern.proc.pathname.<pid> system control node returns a length of zero
without modifying the user's buffer.  Detect this case and return NULL
rather than the previous contents of the static buffer 'buf'.

gdb/ChangeLog:

* fbsd-nat.c (fbsd_pid_to_exec_file) [KERN_PROC_PATHNAME]: Return
NULL for an empty pathname.
gdb/ChangeLog
gdb/fbsd-nat.c