From 602d41e523e7f1ee427c34740cb2d5996bf7a0d4 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Tue, 20 Sep 1994 18:39:25 +0000 Subject: * coffread.c (init_stringtab): When copying length to stringtab, use target format, not host format, since that is what the rest of the code assumes. --- gdb/coffread.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/coffread.c') diff --git a/gdb/coffread.c b/gdb/coffread.c index 0706665..9350d45 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1085,7 +1085,9 @@ init_stringtab (abfd, offset) return 0; stringtab = (char *) xmalloc (length); - memcpy (stringtab, &length, sizeof length); + /* This is in target format (probably not very useful, and not currently + used), not host format. */ + memcpy (stringtab, lengthbuf, sizeof lengthbuf); if (length == sizeof length) /* Empty table -- just the count */ return 0; @@ -1113,6 +1115,8 @@ getsymname (symbol_entry) if (symbol_entry->_n._n_n._n_zeroes == 0) { + /* FIXME: Probably should be detecting corrupt symbol files by + seeing whether offset points to within the stringtab. */ result = stringtab + symbol_entry->_n._n_n._n_offset; } else -- cgit v1.1