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: NJim Meyering <meyering@redhat.com> Reviewed-by: NPeter A.G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Showing
想要评论请 注册 或 登录