Files
kata-containers/qemu
jiangpengfei 5712b1198e qemu/qmp: fix readLoop() reuse scanner.Bytes() underlying array problem
Since []byte channel type transfer slice info(include slice underlying array pointer, len, cap)
between channel sender and receiver. scanner.Bytes() function returned slice's underlying array
may point to data that will be overwritten by a subsequent call to Scan(reference from:
https://golang.org/pkg/bufio/#Scanner.Bytes), which may make consecutive scan() call write the
read data into the same underlying array which causes receiver read mixed data,so we need to
copy line to new allocated space and then send to channel receiver to solve this problem.

Fixes: #88

Signed-off-by: jiangpengfei <jiangpengfei9@huawei.com>
2019-03-13 19:45:05 -04:00
..
2018-11-30 09:34:21 +01:00
2019-01-28 15:32:07 +01:00
2019-01-28 16:19:20 +01:00
2018-12-03 15:56:20 +01:00