nbd/server: Reject 0-length block status request
commitd8b20291cba6aa9bb295885a34f2b5f05d59d1b2
authorEric Blake <eblake@redhat.com>
Thu, 21 Jun 2018 12:49:37 +0000 (21 07:49 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 21 Jun 2018 14:21:34 +0000 (21 09:21 -0500)
tree0e9c8106d6cc7a9e1b7798bf48a9301f97a599a2
parentac5de4984df282d64feb4af33b92e0a75652e2b6
nbd/server: Reject 0-length block status request

The NBD spec says that behavior is unspecified if the client
requests 0 length for block status; but since the structured
reply is documenting as returning a non-zero length, it's
easier to just diagnose this with an EINVAL error than to
figure out what to return.

CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180621124937.166549-1-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
nbd/server.c