Re: [Qemu-devel] [PATCH] scsi: handle the special parameters

2018-01-15 Thread Paolo Bonzini
On 15/01/2018 05:16, linzhecheng wrote: > scsi_disk_emulate_command calls > scsi_build_sense(NULL, 0, outbuf, r->buflen, > (req->cmd.buf[1] & 1) == 0); > But scsi_convert_sense doesn't handle the case when in_buf is NULL > or in_len is 0, which will lead to segfaul

[Qemu-devel] [PATCH] scsi: handle the special parameters

2018-01-14 Thread linzhecheng
scsi_disk_emulate_command calls scsi_build_sense(NULL, 0, outbuf, r->buflen, (req->cmd.buf[1] & 1) == 0); But scsi_convert_sense doesn't handle the case when in_buf is NULL or in_len is 0, which will lead to segfault. Signed-off-by: linzhecheng --- scsi/utils.c