diff options
author | Andreas Jaeger <aj@suse.de> | 2004-02-13 16:12:47 +0000 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2004-02-13 16:12:47 +0000 |
commit | 4e1a97bb6a6cd3f500788ce686eef25b7f83cbb0 (patch) | |
tree | e0ae3e3426721dad9b13d1804eb3803c548d5038 | |
parent | fec724b4bd59f717667b2fcf73908eb7aa3f410d (diff) | |
download | binutils-redhat-cagney_bfdfile-20040213-branch.tar.gz |
2004-02-13 Hannes Reinecke <hare@suse.de>cagney_bfdfile-20040213-branchpointcagney_bfdfile-20040213-branch
Jakub Jelinek <jakub@redhat.com>
* dwarf2dbg.c (get_filenum): Do not read beyond allocated memory.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/dwarf2dbg.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 50ded9372f..0e33bb2236 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2004-02-13 Hannes Reinecke <hare@suse.de> + Jakub Jelinek <jakub@redhat.com> + + * dwarf2dbg.c (get_filenum): Do not read beyond allocated memory. + 2004-02-10 Steve Ellcey <sje@cup.hp.com> * config/tc-ia64.h (ia64_frob_symbol): New declaration. diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 064a743229..3336453a4e 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1,5 +1,5 @@ /* dwarf2dbg.c - DWARF2 debug support - Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by David Mosberger-Tang <davidm@hpl.hp.com> This file is part of GAS, the GNU Assembler. @@ -372,7 +372,7 @@ get_filenum (const char *filename, unsigned int num) { --dir_len; for (dir = 1; dir < dirs_in_use; ++dir) - if (memcmp (filename, dirs[dir], dir_len) == 0 + if (strncmp (filename, dirs[dir], dir_len) == 0 && dirs[dir][dir_len] == '\0') break; |