From c4464494146af06f1b7a835e8aacad9edc491982 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Fri, 19 Jun 2020 21:18:30 +0200 Subject: prog/encodingexec: pad data args with zero bytes We must pad data arguments with known values when serializing them into the given destination buffer because it could be reused and contain random bytes from previous use. Signed-off-by: Alexander Egorenkov --- prog/encodingexec.go | 1 + 1 file changed, 1 insertion(+) (limited to 'prog/encodingexec.go') diff --git a/prog/encodingexec.go b/prog/encodingexec.go index 99357dfd2..78eae81ae 100644 --- a/prog/encodingexec.go +++ b/prog/encodingexec.go @@ -275,6 +275,7 @@ func (w *execContext) writeArg(arg Arg) { w.eof = true } else { copy(w.buf, data) + copy(w.buf[len(data):], make([]byte, 8)) w.buf = w.buf[padded:] } case *UnionArg: -- cgit mrf-deployment