Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32094
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
payloads/coreinfo: Free buffer before returning
This resolves CID 1373370 (RESOURCE_LEAK), which was partially fixed in 2d1e0eb.
Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: I0efe94b9dfb27746828055427029c01c7f407ec2 --- M payloads/coreinfo/timestamps_module.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/32094/1
diff --git a/payloads/coreinfo/timestamps_module.c b/payloads/coreinfo/timestamps_module.c index 0978f31..fe2d2b5 100644 --- a/payloads/coreinfo/timestamps_module.c +++ b/payloads/coreinfo/timestamps_module.c @@ -203,8 +203,10 @@ SCREEN_X, LINES_SHOWN);
/* Sanity check, chars_count must be padded to full line */ - if (chars_count % SCREEN_X != 0) + if (chars_count % SCREEN_X != 0) { + free(buffer); return -2; + }
g_lines_count = chars_count / SCREEN_X; g_max_cursor_line = MAX(g_lines_count - 1 - LINES_SHOWN, 0);
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32094 )
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/#/c/32094/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32094/1//COMMIT_MSG@10 PS1, Line 10: partially fixed in 2d1e0eb. Please also add the commit message summary after the hash in ().
https://review.coreboot.org/#/c/32094/1//COMMIT_MSG@11 PS1, Line 11: Better add a tag for Coverity.
Found-by: Coverity (CID 1373370 (RESOURCE_LEAK))
Hello build bot (Jenkins), Martin Roth, Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32094
to look at the new patch set (#2).
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
payloads/coreinfo: Free buffer before returning
This fixes a memory leak, which was partially resolved in 2d1e0eb (payloads/coreinfo: Free buffer before returning).
Found-by: Coverity (CID 1373370 - RESOURCE_LEAK) Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: I0efe94b9dfb27746828055427029c01c7f407ec2 --- M payloads/coreinfo/timestamps_module.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/32094/2
Jacob Garber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32094 )
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/#/c/32094/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32094/1//COMMIT_MSG@10 PS1, Line 10: partially fixed in 2d1e0eb.
Please also add the commit message summary after the hash in ().
Done
https://review.coreboot.org/#/c/32094/1//COMMIT_MSG@11 PS1, Line 11:
Better add a tag for Coverity. […]
Done
Hello build bot (Jenkins), Martin Roth, Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32094
to look at the new patch set (#3).
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
payloads/coreinfo: Free buffer before returning
This fixes a memory leak, which was partially resolved in 2d1e0eb (payloads/coreinfo: Free buffer before returning).
Found-by: Coverity Scan, CID 1373370 (RESOURCE_LEAK) Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: I0efe94b9dfb27746828055427029c01c7f407ec2 --- M payloads/coreinfo/timestamps_module.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/32094/3
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32094 )
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
Patch Set 3: Code-Review+1
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32094 )
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32094 )
Change subject: payloads/coreinfo: Free buffer before returning ......................................................................
payloads/coreinfo: Free buffer before returning
This fixes a memory leak, which was partially resolved in 2d1e0eb (payloads/coreinfo: Free buffer before returning).
Found-by: Coverity Scan, CID 1373370 (RESOURCE_LEAK) Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: I0efe94b9dfb27746828055427029c01c7f407ec2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/32094 Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Reviewed-by: Patrick Rudolph siro@das-labor.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M payloads/coreinfo/timestamps_module.c 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Patrick Rudolph: Looks good to me, approved
diff --git a/payloads/coreinfo/timestamps_module.c b/payloads/coreinfo/timestamps_module.c index 0978f31..fe2d2b5 100644 --- a/payloads/coreinfo/timestamps_module.c +++ b/payloads/coreinfo/timestamps_module.c @@ -203,8 +203,10 @@ SCREEN_X, LINES_SHOWN);
/* Sanity check, chars_count must be padded to full line */ - if (chars_count % SCREEN_X != 0) + if (chars_count % SCREEN_X != 0) { + free(buffer); return -2; + }
g_lines_count = chars_count / SCREEN_X; g_max_cursor_line = MAX(g_lines_count - 1 - LINES_SHOWN, 0);