aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-02-13 14:35:24 +0000
committerNick Clifton <nickc@redhat.com>2017-02-13 14:35:24 +0000
commit4aeb00ad3cc6a29b32f0a4e42c2f64d55e25b76d (patch)
tree7241eebc7791cb4b541f3f1e59c2762b308aff52 /binutils/readelf.c
parent0ee3043f58aae078a1ecc54b7be2810cae39a718 (diff)
downloadgdb-4aeb00ad3cc6a29b32f0a4e42c2f64d55e25b76d.zip
gdb-4aeb00ad3cc6a29b32f0a4e42c2f64d55e25b76d.tar.gz
gdb-4aeb00ad3cc6a29b32f0a4e42c2f64d55e25b76d.tar.bz2
Fix check for buffer overflow when processing version information.
PR binutils/21148 * readelf.c (process_version_sections): Include size of auxillary version information when checking for buffer overflow.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 6fd7ff7..a61befe 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -10019,7 +10019,7 @@ process_version_sections (FILE * file)
ent.vd_ndx, ent.vd_cnt);
/* Check for overflow. */
- if (ent.vd_aux > (size_t) (endbuf - vstart))
+ if (ent.vd_aux + sizeof (* eaux) > (size_t) (endbuf - vstart))
break;
vstart += ent.vd_aux;