]> git.proxmox.com Git - mirror_qemu.git/commit
nbd/client: fix nbd_negotiate_simple_meta_context
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 27 Apr 2018 14:20:01 +0000 (17:20 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 11 Jul 2018 16:48:21 +0000 (11:48 -0500)
commitf155487beffb720a8ca7fe88f3b05bea0ddb2a56
tree6cac9d702ce32e7a10401bef9db230f0bba689c4
parent54eb6cc6d7ad88ee634fc95a435dc5072f90c019
nbd/client: fix nbd_negotiate_simple_meta_context

Initialize received variable. Otherwise, is is possible for server to
answer without any contexts, but we will set context_id to something
random (received_id is not initialized too) and return 1, which is
wrong.

To solve it, just initialize received to false. Initialize received_id
too, just to make all possible checkers happy.

Bug was introduced in 78a33ab58782efdb206de14 "nbd: BLOCK_STATUS for
standard get_block_status function: client part" with the whole
function.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180427142002.21930-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 89aa0d87634e2cb98517509dc8bdb876f26ecf8b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
nbd/client.c