From: "Michael S. Tsirkin" <mst@redhat.com> To: qemu-devel@nongnu.org Cc: Peter Maydell <peter.maydell@linaro.org>, Liam Merwick <liam.merwick@oracle.com>, Igor Mammedov <imammedo@redhat.com> Subject: [Qemu-devel] [PULL 1/5] acpi: verify file entries in bios_linker_loader_add_pointer() Date: Fri, 5 Apr 2019 19:12:39 -0400 [thread overview] Message-ID: <1553199229-25318-1-git-send-email-liam.merwick@oracle.com> (raw) In-Reply-To: <20190405231225.30165-1-mst@redhat.com> From: Liam Merwick <liam.merwick@oracle.com> 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> --- hw/acpi/bios-linker-loader.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- MST
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com> To: qemu-devel@nongnu.org Cc: Peter Maydell <peter.maydell@linaro.org>, Igor Mammedov <imammedo@redhat.com> Subject: [Qemu-devel] [PULL 1/5] acpi: verify file entries in bios_linker_loader_add_pointer() Date: Fri, 5 Apr 2019 19:12:39 -0400 [thread overview] Message-ID: <1553199229-25318-1-git-send-email-liam.merwick@oracle.com> (raw) Message-ID: <20190405231239.NLtoS6k4o3m2d8yvn1WsTB4g3e2mafH-kY7NCSBsfVM@z> (raw) In-Reply-To: <20190405231225.30165-1-mst@redhat.com> From: Liam Merwick <liam.merwick@oracle.com> 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> --- hw/acpi/bios-linker-loader.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- MST
next prev parent reply other threads:[~2019-04-05 23:12 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-05 23:12 [Qemu-devel] [PULL 0/5] pci, pc, virtio: fixes Michael S. Tsirkin 2019-04-05 23:12 ` Michael S. Tsirkin 2019-04-05 23:12 ` Michael S. Tsirkin [this message] 2019-04-05 23:12 ` [Qemu-devel] [PULL 1/5] acpi: verify file entries in bios_linker_loader_add_pointer() Michael S. Tsirkin 2019-04-05 23:12 ` [Qemu-devel] [PULL 2/5] intel_iommu: Correct caching-mode error message Michael S. Tsirkin 2019-04-05 23:12 ` Michael S. Tsirkin 2019-04-05 23:12 ` [Qemu-devel] [PULL 3/5] virtio-net: Fix typo in comment Michael S. Tsirkin 2019-04-05 23:12 ` Michael S. Tsirkin 2019-04-05 23:12 ` [Qemu-devel] [PULL 4/5] intel_iommu: Fix root_scalable migration breakage Michael S. Tsirkin 2019-04-05 23:12 ` Michael S. Tsirkin 2019-04-05 23:12 ` [Qemu-devel] [PULL 5/5] intel_iommu: Drop extended root field Michael S. Tsirkin 2019-04-05 23:12 ` Michael S. Tsirkin 2019-04-08 9:49 ` [Qemu-devel] [PULL 0/5] pci, pc, virtio: fixes Peter Maydell 2019-04-08 9:49 ` Peter Maydell
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1553199229-25318-1-git-send-email-liam.merwick@oracle.com \ --to=mst@redhat.com \ --cc=imammedo@redhat.com \ --cc=liam.merwick@oracle.com \ --cc=peter.maydell@linaro.org \ --cc=qemu-devel@nongnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).