Name of user not set #1003143 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48531 )
Change subject: lib/fmap: Add null parameters handling ......................................................................
lib/fmap: Add null parameters handling
Prevent segmentation fault when passing NULL as parameters.
Signed-off-by: Jakub Czapiga jacz@semihalf.com Change-Id: Ie712d040b1c2383dcc8884e5f779c3591ccf0163 --- M src/lib/fmap.c 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/48531/1
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;
Hello Patrick Georgi, Paul Fagerburg, Julius Werner, Jan Dabros,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48531
to look at the new patch set (#2).
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 --- M src/lib/fmap.c 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/48531/2
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48531 )
Change subject: lib/fmap: Add null parameters handling ......................................................................
Patch Set 2: Code-Review+2
I noticed we don't have a unit test for fmap yet. When that unit test is written, make sure it includes cases for calling fmap_locate_area and fmap_find_region_name with all the combinations of NULL parameters.
Name of user not set #1003143 has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48531 )
Change subject: lib/fmap: Add null parameters handling ......................................................................
Patch Set 2:
Patch Set 2: Code-Review+2
I noticed we don't have a unit test for fmap yet. When that unit test is written, make sure it includes cases for calling fmap_locate_area and fmap_find_region_name with all the combinations of NULL parameters.
Work on fmap unit tests is in progress. I found the issue addressed by this patch while writing a case with NULL parameters.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48531 )
Change subject: lib/fmap: Add null parameters handling ......................................................................
Patch Set 2:
Patch Set 2:
Patch Set 2: Code-Review+2
I noticed we don't have a unit test for fmap yet. When that unit test is written, make sure it includes cases for calling fmap_locate_area and fmap_find_region_name with all the combinations of NULL parameters.
Work on fmap unit tests is in progress. I found the issue addressed by this patch while writing a case with NULL parameters.
:-D
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;