efi_selftest: fix ESRT creation tests
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 8 Jul 2025 11:37:32 +0000 (13:37 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 26 Jul 2025 05:37:03 +0000 (07:37 +0200)
commitca01c847f6c76fbcfc6e3b483b791f070621bda6
treeb46428f7d77b95e67edd83bff754678bbdb56019
parent7e2506e3a247c787a9ad4b4db00bc8e6a348df90
efi_selftest: fix ESRT creation tests

The code foresees that parameters descriptor_size and descriptor_count
might be NULL and then dereferences them without further check.

The size check must take into account the descriptor count.

ImageInfo might be NULL. In this case we must not dereference it.

Fixes: 4ac6041c3cbf ("efi: ESRT creation tests")
Addresses-Coverity-ID: CID 569497: Null pointer dereferences (FORWARD_NULL)
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_selftest/efi_selftest_esrt.c