Skip to content
Commit 5cd2b85e authored by Ciaran Woodward's avatar Ciaran Woodward Committed by Tom Tromey
Browse files

gdb/riscv: Fix oob memory access when printing info registers



If the length of a register name was greater than 15,
print_spaces was called with a negative number, which
prints random data from the heap instead of the requested
number of spaces.

This could happen if a target-description file was used
to specify additional long-named registers.

Fix is simple - don't ask for fewer than 1 space (since
we still want column separation).

Approved-by: default avatarKevin Buettner <kevinb@redhat.com>
parent 358be6e7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment