aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 2b90351..e906bdf 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-21 Alan Modra <amodra@gmail.com>
+
+ * readelf.c (get_num_dynamic_syms): Bounds check mipsxlat array
+ access.
+
2020-05-20 Nelson Chu <nelson.chu@sifive.com>
* dwarf.c: Updated since DECLARE_CSR is changed.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 87bb574..798782c 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -10211,7 +10211,8 @@ get_num_dynamic_syms (Filedata * filedata)
{
if (filedata->dynamic_info_DT_MIPS_XHASH)
{
- if (filedata->mipsxlat[off] >= num_of_syms)
+ if (off < filedata->ngnuchains
+ && filedata->mipsxlat[off] >= num_of_syms)
num_of_syms = filedata->mipsxlat[off] + 1;
}
else