Paul Fagerburg has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48531 )
Change subject: lib/fmap: Add null parameters handling ......................................................................
lib/fmap: Add null parameters handling
Prevent null-pointer access when passed as parameter.
Signed-off-by: Jakub Czapiga jacz@semihalf.com Change-Id: Ie712d040b1c2383dcc8884e5f779c3591ccf0163 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48531 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Paul Fagerburg pfagerburg@chromium.org --- M src/lib/fmap.c 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Paul Fagerburg: Looks good to me, approved
diff --git a/src/lib/fmap.c b/src/lib/fmap.c index 2abe138..418e715 100644 --- a/src/lib/fmap.c +++ b/src/lib/fmap.c @@ -164,6 +164,9 @@ struct region_device fmrd; size_t offset;
+ if (name == NULL || ar == NULL) + return -1; + if (find_fmap_directory(&fmrd)) return -1;
@@ -206,6 +209,9 @@ struct region_device fmrd; size_t offset;
+ if (name == NULL || ar == NULL) + return -1; + if (find_fmap_directory(&fmrd)) return -1;