From 0270a750ba588a8ad521e68be851772bac9c44f1 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 26 Nov 2012 14:19:33 +0000 Subject: gdb/ 2012-11-26 Maxime Villard Pedro Alves * common/linux-osdata.c (linux_xfer_osdata_fds): Decrease buffer size parameter passed to readlink by one byte. * fbsd-nat.c (fbsd_pid_to_exec_file): Ditto. * linux-nat.c (linux_child_pid_to_exec_file): Ditto. * nbsd-nat.c (nbsd_pid_to_exec_file): Ditto. * inf-child.c (inf_child_fileio_readlink): Decrease local buffer's size by one byte. gdb/gdbserver/ 2012-11-26 Maxime Villard * hostio.c (handle_readlink): Decrease buffer size parameter passed to readlink by one byte. --- gdb/linux-nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/linux-nat.c') diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 45f7e24..f5ca977 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4319,7 +4319,7 @@ linux_child_pid_to_exec_file (int pid) memset (name2, 0, MAXPATHLEN); sprintf (name1, "/proc/%d/exe", pid); - if (readlink (name1, name2, MAXPATHLEN) > 0) + if (readlink (name1, name2, MAXPATHLEN - 1) > 0) return name2; else return name1; -- cgit v1.1