« Previous | Next » 

Revision 5fbe02e8

ID5fbe02e8bb7c62ee55b8edc5fd688c369164c49c

Added by Jim Meyering almost 12 years ago

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 <>
Reviewed-by: Peter A.G. Crosthwaite <>
Signed-off-by: Peter Maydell <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences