Skip to content

Commit

Permalink
block: vhdx - add error check
Browse files Browse the repository at this point in the history
This add an error check for an invalid descriptor entry signature,
when flushing the log descriptor entries.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
codyprime authored and kevmw committed Aug 15, 2014
1 parent 3c80ca1 commit 349592e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions block/vhdx-log.c
Expand Up @@ -435,6 +435,11 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc,
/* write 'count' sectors of sector */
memset(buffer, 0, VHDX_LOG_SECTOR_SIZE);
count = desc->zero_length / VHDX_LOG_SECTOR_SIZE;
} else {
error_report("Invalid VHDX log descriptor entry signature 0x%" PRIx32,
desc->signature);
ret = -EINVAL;
goto exit;
}

file_offset = desc->file_offset;
Expand Down

0 comments on commit 349592e

Please sign in to comment.