summaryrefslogtreecommitdiffstats
path: root/hw/acpi
diff options
context:
space:
mode:
authorLiam Merwick2019-03-21 21:13:49 +0100
committerMichael S. Tsirkin2019-04-02 17:49:14 +0200
commit22132828d1876c45840f9a40454f6cc0463ada2d (patch)
tree73c12ad479bf76b272dd4b6a62a14d4d58868774 /hw/acpi
parentMerge remote-tracking branch 'remotes/berrange/tags/filemon-next-pull-request... (diff)
downloadqemu-22132828d1876c45840f9a40454f6cc0463ada2d.tar.gz
qemu-22132828d1876c45840f9a40454f6cc0463ada2d.tar.xz
qemu-22132828d1876c45840f9a40454f6cc0463ada2d.zip
acpi: verify file entries in bios_linker_loader_add_pointer()
The callers to bios_linker_find_file() assert that the file entry returned is not NULL, except for those in bios_linker_loader_add_pointer(). Add two asserts in that case for completeness and to facilitate static code analysis. Signed-off-by: Liam Merwick <liam.merwick@oracle.com> Message-Id: <1553199229-25318-1-git-send-email-liam.merwick@oracle.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi')
-rw-r--r--hw/acpi/bios-linker-loader.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c
index d16b8bbcb1..626c04a39f 100644
--- a/hw/acpi/bios-linker-loader.c
+++ b/hw/acpi/bios-linker-loader.c
@@ -283,6 +283,8 @@ void bios_linker_loader_add_pointer(BIOSLinker *linker,
const BiosLinkerFileEntry *source_file =
bios_linker_find_file(linker, src_file);
+ assert(dst_file);
+ assert(source_file);
assert(dst_patched_offset < dst_file->blob->len);
assert(dst_patched_offset + dst_patched_size <= dst_file->blob->len);
assert(src_offset < source_file->blob->len);