aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-09-03 08:34:05 +0930
committerAlan Modra <amodra@gmail.com>2021-09-03 11:45:58 +0930
commit174fe10cb6809390b38e9a3bc2bf88e3eddfe5ee (patch)
tree2c5678d16d5d54460e8ba6be395a32add1cd2f5f
parent06520412a5512988e42ff5f81d59ba0326036830 (diff)
downloadgdb-174fe10cb6809390b38e9a3bc2bf88e3eddfe5ee.zip
gdb-174fe10cb6809390b38e9a3bc2bf88e3eddfe5ee.tar.gz
gdb-174fe10cb6809390b38e9a3bc2bf88e3eddfe5ee.tar.bz2
ubsan: libctf: applying zero offset to null pointer
* ctf-open.c (init_symtab): Avoid ubsan error.
-rw-r--r--libctf/ctf-open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/ctf-open.c b/libctf/ctf-open.c
index 1c69dc8..9e2c570 100644
--- a/libctf/ctf-open.c
+++ b/libctf/ctf-open.c
@@ -238,7 +238,7 @@ init_symtab (ctf_dict_t *fp, const ctf_header_t *hp, const ctf_sect_t *sp)
int skip_func_info = 0;
int i;
uint32_t *xp = fp->ctf_sxlate;
- uint32_t *xend = xp + fp->ctf_nsyms;
+ uint32_t *xend = PTR_ADD (xp, fp->ctf_nsyms);
uint32_t objtoff = hp->cth_objtoff;
uint32_t funcoff = hp->cth_funcoff;