aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-04-27 14:46:09 +0000
committerNick Clifton <nickc@redhat.com>2010-04-27 14:46:09 +0000
commit1ad40a046a1bd1b6b85454f3fda841b068489907 (patch)
treea63e999b775e852f145efdfb66ba77fa7f49363b
parent4d9e2b2774bad5d56d5bd8a232b8bdf64c10bd13 (diff)
downloadgdb-1ad40a046a1bd1b6b85454f3fda841b068489907.zip
gdb-1ad40a046a1bd1b6b85454f3fda841b068489907.tar.gz
gdb-1ad40a046a1bd1b6b85454f3fda841b068489907.tar.bz2
PR gprof/11524
* corefile.c (core_create_syms_from): Use correct size of buffer.
-rw-r--r--gprof/ChangeLog5
-rw-r--r--gprof/corefile.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 55a4a25..e986dac 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-27 Hongsheng Zhang <hongsheng611@gmail.com>
+
+ PR gprof/11524
+ * corefile.c (core_create_syms_from): Use correct size of buffer.
+
2010-04-22 Nick Clifton <nickc@redhat.com>
* po/gprof.pot: Updated by the Translation project.
diff --git a/gprof/corefile.c b/gprof/corefile.c
index 4cca080..b2697f8 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -1,7 +1,7 @@
/* corefile.c
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -517,7 +517,7 @@ core_create_syms_from (const char * sym_table_file)
done (1);
}
- while (!feof (f) && fgets (buf, sizeof (buf), f))
+ while (!feof (f) && fgets (buf, BUFSIZE - 1, f))
{
if (sscanf (buf, "%s %c %s", address, &type, name) == 3)
if (type != 't' && type != 'T')