[PATCH v2] cmd: abootimg: Prevent use of unintialised variable

Mattijs Korpershoek mkorpershoek at kernel.org
Fri Jun 27 08:43:45 CEST 2025


On Wed, Jun 25, 2025 at 17:31, Andrew Goodbody <andrew.goodbody at linaro.org> wrote:

> On 25/06/2025 17:10, Mattijs Korpershoek wrote:

[...]

>
>> android_image_get_data() handles the case where vendor_boot_hdr is NULL:
>> """
>> 	if (((struct andr_boot_img_hdr_v0 *)boot_hdr)->header_version > 2) {
>> 		if (!vendor_boot_hdr) {
>> 			printf("For boot header v3+ vendor boot image has to be provided\n");
>> 			return false;
>> 		}
>> """
>> 
>> So I don't think we should early return here.
>> If we do, we will probably break boot image v2 support.
>
> Well I guess the alternate fix is to just init vhdr to be NULL?

Yes, that would be better.

>
> Andrew
>
>>>   

[...]


More information about the U-Boot mailing list