sim: Fix a possible memory error in copyOutStatfsBuf.
authorGabe Black <gabeblack@google.com>
Mon, 25 May 2020 11:24:11 +0000 (04:24 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 26 May 2020 00:12:10 +0000 (00:12 +0000)
commit1e2f4a8aa6f94a55faa90b071c820b7192fe75c7
treeebdc72733593b1d3c0de5e3b8c1f5e5633e144a0
parentce8a6a0cec21f4df4b7d6c05bf3549d7bbb5818d
sim: Fix a possible memory error in copyOutStatfsBuf.

When memcpy-ing, we need to be sure not to read beyond the end of the
source, or write beyond the end of the target.

Change-Id: I3cf259bedce4c6e88aef47ef5379aab198338cb7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29404
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/syscall_emul.hh