]> Git Repo - qemu.git/commit - nbd/client.c
nbd/client: fix nbd_negotiate_simple_meta_context
authorVladimir Sementsov-Ogievskiy <[email protected]>
Fri, 27 Apr 2018 14:20:01 +0000 (17:20 +0300)
committerEric Blake <[email protected]>
Fri, 4 May 2018 13:23:07 +0000 (08:23 -0500)
commit89aa0d87634e2cb98517509dc8bdb876f26ecf8b
tree714dfa4ecf91541920d8beb2a3936df80776f76e
parent26bd8d98c4b3284a4c6fe3b67c98b1edd00e9beb
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 <[email protected]>
Message-Id: <20180427142002[email protected]>
Reviewed-by: Eric Blake <[email protected]>
CC: [email protected]
Signed-off-by: Eric Blake <[email protected]>
nbd/client.c
This page took 0.022732 seconds and 4 git commands to generate.