diff options
author | Alan Modra <amodra@gmail.com> | 2019-08-07 23:37:49 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-08-08 00:16:05 +0930 |
commit | 7c1c1904bedb8f873731651b420a23f573785728 (patch) | |
tree | dfd8977ec0d6f14abbc5986fde3bc90ba105a26a /cpu | |
parent | f927cc8faff0d2e39561c90f5182ebe99b2f77f6 (diff) | |
download | binutils-7c1c1904bedb8f873731651b420a23f573785728.zip binutils-7c1c1904bedb8f873731651b420a23f573785728.tar.gz binutils-7c1c1904bedb8f873731651b420a23f573785728.tar.bz2 |
Integer overflows in readelf get_data
I noticed the test for overflow of amt = size * nmemb in get_data
wasn't effective. An obvious example of nmemb = 3 and size = half max
value overflows but doesn't result in amt < nmemb. This patch fixes
this problem and reports a size truncation or overflow rather than out
of memory in more cases.
* readelf.c (get_data): Improve overflow checks.
Diffstat (limited to 'cpu')
0 files changed, 0 insertions, 0 deletions