Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34535 )
Change subject: lib: Throw an error when ramdisk is present but initrd.size is 0 ......................................................................
Patch Set 10:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c@54 PS10, Line 54: region Why region and not node?
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c@78 PS10, Line 78: memcpy(dst, node->data, node->size); This could result in a buffer overflow if region->size < node->size. Refactoring the code like so will fix the overflow and print the error on line 96: true_size = min(region->size, node->size); memcpy(dst, node->data, true_size);