diff options
author | Uri Lublin <uril@redhat.com> | 2020-10-11 20:59:17 +0300 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2020-11-03 09:44:05 +0000 |
commit | b7db1c20c9f80154fb54392eb44add3486d3e427 (patch) | |
tree | 7413114b1a91858a986ec3910650386fee08457f | |
parent | e4bfd1b632b6c14e8411dbe3565115a78cd3d256 (diff) |
vdagentd: do not allow to use an already used file-xfer id
Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | src/vdagentd/vdagentd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c index 8437779..78378aa 100644 --- a/src/vdagentd/vdagentd.c +++ b/src/vdagentd/vdagentd.c @@ -404,6 +404,13 @@ static void do_client_file_xfer(VirtioPort *vport, "Cancelling client file-xfer request %u", s->id, VD_AGENT_FILE_XFER_STATUS_ERROR, (void*) &error, detail_size); return; + } else if (g_hash_table_lookup(active_xfers, GUINT_TO_POINTER(s->id)) != NULL) { + // id is already used -- client is confused + send_file_xfer_status(vport, + "File transfer ID is already used. " + "Cancelling client file-xfer request %u", + s->id, VD_AGENT_FILE_XFER_STATUS_ERROR, NULL, 0); + return; } msg_type = VDAGENTD_FILE_XFER_START; id = s->id; |