From 75987f837d86a482443aab3c68a8b84afc600ce5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 22 Jul 1999 00:29:35 +0000 Subject: 1999-07-21 Philippe De Muyter * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error message and fail if a symbol index is out of range. --- bfd/cofflink.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bfd/cofflink.c') diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 994cea4..679e7a8 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -2603,6 +2603,14 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, h = NULL; sym = NULL; } + else if (symndx < 0 + || (unsigned long) symndx >= obj_raw_syment_count (input_bfd)) + { + (*_bfd_error_handler) + ("%s: illegal symbol index %ld in relocs", + bfd_get_filename (input_bfd), symndx); + return false; + } else { h = obj_coff_sym_hashes (input_bfd)[symndx]; -- cgit v1.1