diff options
author | Alberto Garcia <berto@igalia.com> | 2018-03-06 18:14:06 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-03-09 15:17:47 +0100 |
commit | 0cf0e5980bb95a914a40ba0eb8e69c3d75c513fb (patch) | |
tree | 6be0b11d7bf1365030d222d6532fbc1584304870 /tests/qemu-iotests/053 | |
parent | 2fd6163884d74e74dd1ef54ab229d15c61d0b4cb (diff) |
qcow2: Generalize validate_table_offset() into qcow2_validate_table()
This function checks that the offset and size of a table are valid.
While the offset checks are fine, the size check is too generic, since
it only verifies that the total size in bytes fits in a 64-bit
integer. In practice all tables used in qcow2 have much smaller size
limits, so the size needs to be checked again for each table using its
actual limit.
This patch generalizes this function by allowing the caller to specify
the maximum size for that table. In addition to that it allows passing
an Error variable.
The function is also renamed and made public since we're going to use
it in other parts of the code.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/053')
0 files changed, 0 insertions, 0 deletions