Files
u-boot-krane/cmd
AKASHI TakahiroandHeinrich Schuchardt 30f8222bb0 cmd: efidebug: always check return code from get_variable()
CID 316364 says:
> Null pointer dereferences  (FORWARD_NULL)
>	printf("Result total size: 0x%x\n", result->variable_total_size);
at do_efi_capsule_res().

The code is basically safe because a buffer for "result" is allocated
by malloc() and filled up by the second get_variable(), which fails any way
if the allocation has failed.

But the first (and second) get_variable() possibly returns an error other
than EFI_SUCCESS. We always need to check the return code from
get_variable() before accessing the data in "result".

While this change won't suppress CID 316364, the resulting code is much
safer.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-01-23 07:56:53 +01:00
..
2020-12-18 20:32:21 -07:00
2021-01-16 14:48:23 -05:00
2021-01-18 15:23:06 -05:00
2021-01-04 10:51:26 +01:00
2021-01-18 15:23:06 -05:00
2020-12-18 20:32:21 -07:00
2020-12-18 20:32:21 -07:00
2020-12-18 20:32:21 -07:00
2021-01-18 15:23:06 -05:00
2020-12-18 20:32:21 -07:00