diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-26 20:28:40 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-26 23:23:45 +0930 |
commit | e637b7ba2f8399ba94721be3f1765b471b6a67c2 (patch) | |
tree | cb1700224c36381624e8f6051dd1680f67cf343d /gas | |
parent | 4d43072582c3ccbb86485d79107a9d3550a1557a (diff) | |
download | gdb-e637b7ba2f8399ba94721be3f1765b471b6a67c2.zip gdb-e637b7ba2f8399ba94721be3f1765b471b6a67c2.tar.gz gdb-e637b7ba2f8399ba94721be3f1765b471b6a67c2.tar.bz2 |
PR26508 UBSAN: tc-xtensa.c:7764 null pointer bsearch
PR 26508
* config/tc-xtensa.c (xg_get_trampoline_chain): Return early
when n_entries is zero.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-xtensa.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index c56b992..c0d9b26 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,11 @@ 2020-08-26 Alan Modra <amodra@gmail.com> + PR 26508 + * config/tc-xtensa.c (xg_get_trampoline_chain): Return early + when n_entries is zero. + +2020-08-26 Alan Modra <amodra@gmail.com> + PR 26448 * symbols.c: Include limits.h. (resolve_symbol_value <O_left_shift, O_right_shift>): Do an diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 82ec439..af4c667 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -7753,6 +7753,9 @@ xg_get_trampoline_chain (struct trampoline_seg *ts, struct trampoline_chain_index *idx = &ts->chain_index; struct trampoline_chain c; + if (idx->n_entries == 0) + return NULL; + if (idx->needs_sorting) { qsort (idx->entry, idx->n_entries, sizeof (*idx->entry), |