]> Git Repo - qemu.git/commit
cadence_gem: avoid stack-writing buffer-overrun
authorJim Meyering <[email protected]>
Thu, 10 May 2012 06:19:48 +0000 (06:19 +0000)
committerPeter Maydell <[email protected]>
Tue, 19 Jun 2012 13:24:44 +0000 (13:24 +0000)
commit5fbe02e8bb7c62ee55b8edc5fd688c369164c49c
tree35d6f0ee1ff77d4f805034702f7bbe4de40949d9
parentc97338dca0197abad7f0c789ad61d45940f67011
cadence_gem: avoid stack-writing buffer-overrun

Use sizeof(rxbuf)-size (not sizeof(rxbuf-size)) as the number
of bytes to clear.  The latter would always clear 4 or 8
bytes, possibly writing beyond the end of that stack buffer.
Alternatively, depending on the value of the "size" parameter,
it could fail to initialize the end of "rxbuf".
Spotted by coverity.

Signed-off-by: Jim Meyering <[email protected]>
Reviewed-by: Peter A.G. Crosthwaite <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/cadence_gem.c
This page took 0.02827 seconds and 4 git commands to generate.