GDB: Fix out of bounds accesses with limited-length values
authorMaciej W. Rozycki <macro@embecosm.com>
Fri, 24 Feb 2023 12:37:22 +0000 (12:37 +0000)
committerMaciej W. Rozycki <macro@embecosm.com>
Fri, 24 Feb 2023 12:37:22 +0000 (12:37 +0000)
commit0676ec3c22f096bdf98b145b720feeef9493b5bb
tree1acba1333ae32b7087ed420aa4c76f39f3092314
parent7b1792f543161424ce60ff28b9d012a590e220b2
GDB: Fix out of bounds accesses with limited-length values

Fix accesses to limited-length values in `contents_copy_raw' and
`contents_copy_raw_bitwise' so that they observe the limit of the
original allocation.

Reported by Simon Marchi as a heap-buffer-overflow AddressSanitizer
issue triggered with gdb.ada/limited-length.exp.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/value.c