[Spice-commits] 2 commits - .gitlab-ci.yml meson.build src/channel-main.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 7 09:38:37 UTC 2020
.gitlab-ci.yml | 2 ++
meson.build | 2 +-
src/channel-main.c | 16 +++++++++++++---
3 files changed, 16 insertions(+), 4 deletions(-)
New commits:
commit b13fd0664075c951f5418f5828c0803408ad664d
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu Mar 19 06:07:39 2020 +0000
channel-main: Check proper size and caps handling VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE
VDAgentFileXferStatusMessage message can or cannot contain detailed
information attached to it.
Detect this correctly checking capabilities and flags.
This fixes a small buffer overflow reading in case the details are
off the payload.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/meson.build b/meson.build
index 7e26c77..4f2fcba 100644
--- a/meson.build
+++ b/meson.build
@@ -81,7 +81,7 @@ endforeach
#
# check for mandatory dependencies
#
-spice_protocol_version='>= 0.14.1'
+spice_protocol_version='>= 0.14.2'
glib_version = '2.46'
glib_version_info = '>= @0@'.format(glib_version)
diff --git a/src/channel-main.c b/src/channel-main.c
index 6a1bb40..e9295e2 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -1891,6 +1891,7 @@ static void file_xfer_read_async_cb(GObject *source_object,
/* coroutine context */
static void main_agent_handle_xfer_status(SpiceMainChannel *channel,
+ const VDAgentMessage *msg_hdr,
VDAgentFileXferStatusMessage *msg)
{
SpiceFileTransferTask *xfer_task;
@@ -1917,8 +1918,17 @@ static void main_agent_handle_xfer_status(SpiceMainChannel *channel,
_("The spice agent reported an error during the file transfer"));
break;
case VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE: {
- uint64_t *free_space = SPICE_ALIGNED_CAST(uint64_t *, msg->data);
- gchar *free_space_str = g_format_size(*free_space);
+ const VDAgentFileXferStatusNotEnoughSpace *err =
+ (VDAgentFileXferStatusNotEnoughSpace*) msg->data;
+ if (!test_agent_cap(channel, VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS) ||
+ msg_hdr->size < sizeof(*msg) + sizeof(*err)) {
+ error =
+ g_error_new(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
+ _("File transfer failed due to lack of free space on remote machine"));
+ break;
+ }
+
+ gchar *free_space_str = g_format_size(err->disk_free_space);
gchar *file_size_str = g_format_size(spice_file_transfer_task_get_total_bytes(xfer_task));
error = g_error_new(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
_("File transfer failed due to lack of free space on remote machine "
@@ -2112,7 +2122,7 @@ static void main_agent_handle_msg(SpiceChannel *channel,
break;
}
case VD_AGENT_FILE_XFER_STATUS:
- main_agent_handle_xfer_status(self, payload);
+ main_agent_handle_xfer_status(self, msg, payload);
break;
default:
g_warning("unhandled agent message type: %u (%s), size %u",
commit 927d7b931f34b1b503f88dd81fce20cec3429c94
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Sat Apr 4 21:38:05 2020 +0100
ci: Force recursive update of git submodules
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8ab026a..0faea7d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,6 +19,8 @@ variables:
mingw64-gstreamer1-plugins-base mingw64-gstreamer1-plugins-good
mingw64-usbredir mingw32-usbredir
+ GIT_SUBMODULE_STRATEGY: recursive
+
fedora:
artifacts:
paths:
More information about the Spice-commits
mailing list