[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/14] io: error_prepend() in qio_channel_readv_full_all() causes
From: |
Eric Blake |
Subject: |
[PULL 04/14] io: error_prepend() in qio_channel_readv_full_all() causes segfault |
Date: |
Fri, 12 Feb 2021 14:16:09 -0600 |
From: Jagannathan Raman <jag.raman@oracle.com>
Using error_prepend() in qio_channel_readv_full_all() causes a segfault
as errp is not set when ret is 0. This results in the failure of iotest
83. Replacing with error_setg() fixes the problem.
Additionally, removes a full stop at the end of error message
Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Fixes: bebab91ebdfc591f8793a9a17370df1bfbe8b2ca
(io: add qio_channel_readv_full_all_eof & qio_channel_readv_full_all helpers)
Message-Id:
<be476bcdb99e820fec0fa09fe8f04c9dd3e62473.1613128220.git.jag.raman@oracle.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
io/channel.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/io/channel.c b/io/channel.c
index 4555021b6246..e8b019dc36e2 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -202,8 +202,7 @@ int qio_channel_readv_full_all(QIOChannel *ioc,
int ret = qio_channel_readv_full_all_eof(ioc, iov, niov, fds, nfds, errp);
if (ret == 0) {
- error_prepend(errp,
- "Unexpected end-of-file before all data were read.");
+ error_setg(errp, "Unexpected end-of-file before all data were read");
return -1;
}
if (ret == 1) {
--
2.30.1
- [PULL 00/14] NBD patches through 2021-02-12, Eric Blake, 2021/02/12
- [PULL 01/14] qemu-nbd: Use SOMAXCONN for socket listen() backlog, Eric Blake, 2021/02/12
- [PULL 04/14] io: error_prepend() in qio_channel_readv_full_all() causes segfault,
Eric Blake <=
- [PULL 02/14] qemu-nbd: Permit --shared=0 for unlimited clients, Eric Blake, 2021/02/12
- [PULL 03/14] iotests/210: Fix reference output, Eric Blake, 2021/02/12
- [PULL 05/14] block: add new BlockDriver handler: bdrv_cancel_in_flight, Eric Blake, 2021/02/12
- [PULL 07/14] block/raw-format: implement .bdrv_cancel_in_flight handler, Eric Blake, 2021/02/12
- [PULL 08/14] job: add .cancel handler for the driver, Eric Blake, 2021/02/12
- [PULL 06/14] block/nbd: implement .bdrv_cancel_in_flight, Eric Blake, 2021/02/12
- [PULL 09/14] block/mirror: implement .cancel job handler, Eric Blake, 2021/02/12
- [PULL 13/14] block/backup: implement .cancel job handler, Eric Blake, 2021/02/12
- [PULL 14/14] iotests/264: add backup-cancel test-case, Eric Blake, 2021/02/12
- [PULL 11/14] iotests.py: qemu_nbd_popen: remove pid file after use, Eric Blake, 2021/02/12