diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-11-26 15:19:31 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-11-28 11:56:35 +0100 |
commit | 8ffaaba0e939f2a284bb23d1f6f7f9e2104a97e2 (patch) | |
tree | 8d8585af36ee1eeb56c8555b4f0aabd91e38132f /nbd.c | |
parent | c8969eded252058e90e91f12f75f32aceae46ec9 (diff) | |
download | qemu-8ffaaba0e939f2a284bb23d1f6f7f9e2104a97e2.tar.gz qemu-8ffaaba0e939f2a284bb23d1f6f7f9e2104a97e2.tar.bz2 qemu-8ffaaba0e939f2a284bb23d1f6f7f9e2104a97e2.zip |
nbd: fix use of two uninitialized bytes when connecting to a named export
Reported-by: Michal Privoznik <mprivoznik@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd.c')
-rw-r--r-- | nbd.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -397,6 +397,7 @@ static int nbd_send_negotiate(NBDClient *client) rc = -EINVAL; TRACE("Beginning negotiation."); + memset(buf, 0, sizeof(buf)); memcpy(buf, "NBDMAGIC", 8); if (client->exp) { assert ((client->exp->nbdflags & ~65535) == 0); @@ -406,7 +407,6 @@ static int nbd_send_negotiate(NBDClient *client) } else { cpu_to_be64w((uint64_t*)(buf + 8), NBD_OPTS_MAGIC); } - memset(buf + 28, 0, 124); if (client->exp) { if (write_sync(csock, buf, sizeof(buf)) != sizeof(buf)) { |