diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2021-04-16 17:49:52 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-16 17:51:52 -0700 |
commit | ee45334f147c9d5ff75d10c619c9c99ce4ba51ca (patch) | |
tree | 04ffb5bbbf54940c3e6317d5a5552c7a28907bce /pkg/metric | |
parent | 32c18f443f567dac21465b3999d1a18b886891d1 (diff) |
[lisa] Make go_marshal pass correctly sized buffers to safecopy.
gohacks.Memmove() takes in the number of bytes to move. The current generated
code passes len(src) and len(dst) as the number of bytes to move.
However, the marshal.Marshallable interface allows passing in larger buffers.
The stated precondition is that the buffer should be "at least" SizeBytes()
in length but it is allowed to be larger.
This change now correctly calls Memmove with the argument for the number of
bytes to move as type.SizeBytes(). This was caught when I made lisafs use the
Unsafe marshalling API and got a lot of memory violations.
PiperOrigin-RevId: 368952642
Diffstat (limited to 'pkg/metric')
0 files changed, 0 insertions, 0 deletions