From 389946fdaafd7f5f6486df9ef8f26970da94372e Mon Sep 17 00:00:00 2001 From: Hannes Domani Date: Tue, 2 Jul 2024 18:03:26 +0200 Subject: [PATCH] Error out if symbol points to the end of stringtab Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30668 --- gdb/coffread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/coffread.c b/gdb/coffread.c index daae3ffe989..325c08760ba 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1306,7 +1306,7 @@ getsymname (struct internal_syment *symbol_entry) if (symbol_entry->_n._n_n._n_zeroes == 0) { - if (symbol_entry->_n._n_n._n_offset > stringtab_length) + if (symbol_entry->_n._n_n._n_offset >= stringtab_length) error (_("COFF Error: string table offset (%s) outside string table (length %ld)"), hex_string (symbol_entry->_n._n_n._n_offset), stringtab_length); result = stringtab + symbol_entry->_n._n_n._n_offset;