aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2004-02-13 16:12:47 +0000
committerAndreas Jaeger <aj@suse.de>2004-02-13 16:12:47 +0000
commit4dde8e6152ff6e045f3c774911698703daf20184 (patch)
treef08bd9b85d8a77c10a7fc0e9914607223043e77f /gas/dwarf2dbg.c
parent340b6d9120b3ff2186e2f24b96389c35ebbdcac5 (diff)
downloadgdb-4dde8e6152ff6e045f3c774911698703daf20184.zip
gdb-4dde8e6152ff6e045f3c774911698703daf20184.tar.gz
gdb-4dde8e6152ff6e045f3c774911698703daf20184.tar.bz2
2004-02-13 Hannes Reinecke <hare@suse.de>
Jakub Jelinek <jakub@redhat.com> * dwarf2dbg.c (get_filenum): Do not read beyond allocated memory.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 064a743..3336453 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;