From: Alex Bligh Date: Wed, 18 May 2011 18:02:48 +0000 (+0100) Subject: copy handle on all requests X-Git-Url: http://git.alex.org.uk copy handle on all requests --- diff --git a/nbd-server.c b/nbd-server.c index 21fa563..4122cef 100644 --- a/nbd-server.c +++ b/nbd-server.c @@ -1452,8 +1452,9 @@ int mainloop(CLIENT *client) { "READ", (unsigned long long)request.from, (unsigned long long)request.from / 512, len); #endif + memcpy(reply.handle, request.handle, sizeof(reply.handle)); + if ((command==NBD_CMD_WRITE) || (command==NBD_CMD_READ)) { - memcpy(reply.handle, request.handle, sizeof(reply.handle)); if ((request.from + len) > (OFFT_MAX)) { DEBUG("[Number too large!]"); ERROR(client, reply, EINVAL);