Name of user not set #1003143 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48627 )
Change subject: commonlib/region: Add null parameters handling ......................................................................
commonlib/region: Add null parameters handling
Prevent NULL-pointer dereference of child or parent root_device parameter.
Signed-off-by: Jakub Czapiga jacz@semihalf.com Change-Id: I6b9c2b4a3dc2f4f31a40fd045d1fa2d2d1df3eca --- M src/commonlib/region.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/48627/1
diff --git a/src/commonlib/region.c b/src/commonlib/region.c index a10702a..efb7b1f 100644 --- a/src/commonlib/region.c +++ b/src/commonlib/region.c @@ -141,6 +141,9 @@ .size = size, };
+ if (child == NULL || parent == NULL) + return -1; + if (!normalize_and_ok(&parent->region, &req)) return -1;