diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-19 14:20:23 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-19 14:20:23 -0400 |
commit | f408d82c7a140268c3b7be35970c96d8385b5902 (patch) | |
tree | 7920efab8daf34e13bd9ddc8cce9c3d105935b0f /gdb/c-lang.c | |
parent | 98c59b527b1472b87a9ee4959c4bfae85061bc1d (diff) | |
download | binutils-f408d82c7a140268c3b7be35970c96d8385b5902.zip binutils-f408d82c7a140268c3b7be35970c96d8385b5902.tar.gz binutils-f408d82c7a140268c3b7be35970c96d8385b5902.tar.bz2 |
gdb: fix off-by-one error in quirk_rust_enum
Found by inspection, so I don't have a test for it (I don't think it
would be easy to have this bug cause a failure reliably).
We allocate space for N fields into `new_fields`, then memcpy N fields
at `new_fields + 1`. This overflows the allocated buffer by one field.
Fix it by allocating `N + 1` fields.
gdb/ChangeLog:
* dwarf2/read.c (quirk_rust_enum): Allocate enough fields.
Diffstat (limited to 'gdb/c-lang.c')
0 files changed, 0 insertions, 0 deletions