aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
authorLionel Flandrin <lionel@svkt.org>2016-11-08 10:27:36 +0000
committerPedro Alves <palves@redhat.com>2016-11-08 10:27:36 +0000
commit9dc193c3be85aafa60ceff57d3b0430af607b4ce (patch)
treed900edb55d55df5315db1db846c6ac9dd16fde49 /gdb/rust-lang.c
parentec7b600bf1410f6bda239666fac258a605dc3f43 (diff)
downloadbinutils-9dc193c3be85aafa60ceff57d3b0430af607b4ce.zip
binutils-9dc193c3be85aafa60ceff57d3b0430af607b4ce.tar.gz
binutils-9dc193c3be85aafa60ceff57d3b0430af607b4ce.tar.bz2
Check for truncated registers in process_g_packet
While investigating an unrelated issue in remote.c I noticed that the bound checking for 'g' packets was bogus: The previous code would only check that the first byte of the register was within bounds before passing the buffer to regcache_raw_supply. If it turned out that the register in the 'g' packet was incomplete then regcache_raw_supply would proceed to memcpy out-of-bounds. Since the buffer is allocated with alloca it's relatively unlikely to crash (you just end up dumping gdb's stack into the cache) but it's still a bit messy. I changed this logic to check for truncated registers and raise an error if one is encountered. Hopefully it should make debugging remote stubs a bit easier. gdb/ChangeLog: 2016-11-08 Lionel Flandrin <lionel@svkt.org> * remote.c (process_g_packet): Detect truncated registers in 'g' packets and raise an error.
Diffstat (limited to 'gdb/rust-lang.c')
0 files changed, 0 insertions, 0 deletions