Change in ...coreboot[master]: Fix NULL dereference issues found by Klocwork
Thejaswani Putta has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33625 Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Fix NULL dereference issues found by Klocwork Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com> Change-Id: Ia63ab85af610f5d83b5bd6596916a1d4d459adbf Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 --- M payloads/libpayload/curses/form/fty_alnum.c M payloads/libpayload/curses/form/fty_alpha.c M payloads/libpayload/curses/form/fty_enum.c M payloads/libpayload/curses/form/fty_int.c M src/soc/intel/cannonlake/romstage/fsp_params.c 5 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/33625/1 diff --git a/payloads/libpayload/curses/form/fty_alnum.c b/payloads/libpayload/curses/form/fty_alnum.c index cda23dc..7c4f1bc 100644 --- a/payloads/libpayload/curses/form/fty_alnum.c +++ b/payloads/libpayload/curses/form/fty_alnum.c @@ -163,6 +163,8 @@ unsigned char *bp = (unsigned char *)field_buffer(field, 0); bool result = (width < 0); + if(bp == NULL) + return result; Check_CTYPE_Field(result, bp, width, Check_This_Character); return (result); } diff --git a/payloads/libpayload/curses/form/fty_alpha.c b/payloads/libpayload/curses/form/fty_alpha.c index 917a9e0..336658a 100644 --- a/payloads/libpayload/curses/form/fty_alpha.c +++ b/payloads/libpayload/curses/form/fty_alpha.c @@ -163,6 +163,8 @@ unsigned char *bp = (unsigned char *)field_buffer(field, 0); bool result = (width < 0); + if(bp == NULL) + return result; Check_CTYPE_Field(result, bp, width, Check_This_Character); return (result); } diff --git a/payloads/libpayload/curses/form/fty_enum.c b/payloads/libpayload/curses/form/fty_enum.c index 2fd96f0..4d1edb1 100644 --- a/payloads/libpayload/curses/form/fty_enum.c +++ b/payloads/libpayload/curses/form/fty_enum.c @@ -293,6 +293,8 @@ char *s, *t, *p; int res; + if(bp == NULL) + return FALSE; while (kwds && (s = (*kwds++))) { if ((res = Compare((unsigned char *)s, bp, ccase)) != NOMATCH) @@ -348,6 +350,9 @@ int cnt = args->count; unsigned char *bp = (unsigned char *)field_buffer(field, 0); + if (bp == NULL) + return FALSE; + if (kwds) { while (cnt--) @@ -386,6 +391,8 @@ bool ccase = args->checkcase; unsigned char *bp = (unsigned char *)field_buffer(field, 0); + if(bp == NULL) + return FALSE; if (kwds) { while (cnt--) diff --git a/payloads/libpayload/curses/form/fty_int.c b/payloads/libpayload/curses/form/fty_int.c index 0eddedf..e9ea995 100644 --- a/payloads/libpayload/curses/form/fty_int.c +++ b/payloads/libpayload/curses/form/fty_int.c @@ -172,6 +172,8 @@ char buf[100]; bool result = FALSE; + if( bp == NULL) + return result; while (*bp && *bp == ' ') bp++; if (*bp) diff --git a/src/soc/intel/cannonlake/romstage/fsp_params.c b/src/soc/intel/cannonlake/romstage/fsp_params.c index 77bad8f..c47d193 100644 --- a/src/soc/intel/cannonlake/romstage/fsp_params.c +++ b/src/soc/intel/cannonlake/romstage/fsp_params.c @@ -102,7 +102,8 @@ { const struct device *dev = dev_find_slot(0, PCH_DEVFN_LPC); const struct device *smbus = dev_find_slot(0, PCH_DEVFN_SMBUS); - assert(dev != NULL); + if (dev == NULL) + return; const config_t *config = dev->chip_info; FSP_M_CONFIG *m_cfg = &mupd->FspmConfig; FSP_M_TEST_CONFIG *tconfig = &mupd->FspmTestConfig; -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 1 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-MessageType: newchange
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 1: (24 comments) https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alnum.c: https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 166: if(bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 166: if(bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 166: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alpha.c: https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 166: if(bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 166: if(bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 166: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_enum.c: https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 296: if(bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 296: if(bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 296: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 297: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 353: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 353: if (bp == NULL) suspect code indent for conditional statements (2, 3) https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 354: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 394: if(bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 394: if(bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 394: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 395: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_int.c: https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 175: if( bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 175: if( bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 175: if( bp == NULL) space prohibited after that open parenthesis '(' https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 175: if( bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/1/payloads/libpayload/curses/form/fty_... PS1, Line 176: return result; please, no spaces at the start of a line -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 1 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-CC: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Comment-Date: Thu, 20 Jun 2019 00:13:52 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Hello build bot (Jenkins), I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/33625 to look at the new patch set (#2). Change subject: Not ready for review Fix NULL dereference issues found by Klocwork ...................................................................... Not ready for review Fix NULL dereference issues found by Klocwork Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com> Change-Id: Ia63ab85af610f5d83b5bd6596916a1d4d459adbf Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 --- M payloads/libpayload/curses/form/fty_alnum.c M payloads/libpayload/curses/form/fty_alpha.c M payloads/libpayload/curses/form/fty_enum.c M payloads/libpayload/curses/form/fty_int.c M src/soc/intel/cannonlake/romstage/fsp_params.c 5 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/33625/2 -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 2 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-MessageType: newpatchset
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Not ready for review Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 2: (2 comments) https://review.coreboot.org/#/c/33625/2//COMMIT_MSG Commit Message: https://review.coreboot.org/#/c/33625/2//COMMIT_MSG@11 PS2, Line 11: Change-Id: Ia63ab85af610f5d83b5bd6596916a1d4d459adbf Remove this line https://review.coreboot.org/#/c/33625/2/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_int.c: https://review.coreboot.org/#/c/33625/2/payloads/libpayload/curses/form/fty_... PS2, Line 175: Extra space? -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 2 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-Comment-Date: Thu, 20 Jun 2019 09:46:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Hello build bot (Jenkins), I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/33625 to look at the new patch set (#3). Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Fix NULL dereference issues found by Klocwork Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com> Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 --- M payloads/libpayload/curses/form/fty_alnum.c M payloads/libpayload/curses/form/fty_alpha.c M payloads/libpayload/curses/form/fty_enum.c M payloads/libpayload/curses/form/fty_int.c M src/soc/intel/cannonlake/romstage/fsp_params.c 5 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/33625/3 -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 3 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-MessageType: newpatchset
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 3: (5 comments) https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alnum.c: https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... PS3, Line 166: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alpha.c: https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... PS3, Line 166: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_enum.c: https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... PS3, Line 296: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... PS3, Line 394: if(bp == NULL) space required before the open parenthesis '(' https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_int.c: https://review.coreboot.org/#/c/33625/3/payloads/libpayload/curses/form/fty_... PS3, Line 175: if(bp == NULL) space required before the open parenthesis '(' -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 3 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-Comment-Date: Thu, 20 Jun 2019 22:00:27 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Hello build bot (Jenkins), I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/33625 to look at the new patch set (#4). Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Fix NULL dereference issues found by Klocwork Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com> Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 --- M payloads/libpayload/curses/form/fty_alnum.c M payloads/libpayload/curses/form/fty_alpha.c M payloads/libpayload/curses/form/fty_enum.c M payloads/libpayload/curses/form/fty_int.c M src/soc/intel/cannonlake/romstage/fsp_params.c 5 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/33625/4 -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 4 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-MessageType: newpatchset
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 4: (1 comment) https://review.coreboot.org/#/c/33625/4/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alnum.c: https://review.coreboot.org/#/c/33625/4/payloads/libpayload/curses/form/fty_... PS4, Line 166: Oops, the indentation for the libpayload changes became tabs. -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 4 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-Comment-Date: Fri, 21 Jun 2019 01:14:57 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Pratikkumar V Prajapati has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 4: (2 comments) https://review.coreboot.org/#/c/33625/4/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_int.c: https://review.coreboot.org/#/c/33625/4/payloads/libpayload/curses/form/fty_... PS4, Line 175: if (bp == NULL) : return result; Seems like curses code has mix of spaces and tabs. i guess spaces are fine for now, but later we might have to revisit to reformat the code. https://review.coreboot.org/#/c/33625/4/src/soc/intel/cannonlake/romstage/fs... File src/soc/intel/cannonlake/romstage/fsp_params.c: https://review.coreboot.org/#/c/33625/4/src/soc/intel/cannonlake/romstage/fs... PS4, Line 102: : const struct device *dev = dev_find_slot(0, PCH_DEVFN_LPC); : const struct device *smbus = dev_find_slot(0, PCH_DEVFN_SMBUS); : if (dev == NULL) : return; push a seperate patch for SOC -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 4 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-Comment-Date: Fri, 21 Jun 2019 18:54:04 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Hello Pratikkumar V Prajapati, AndreX Andraos, Julius Werner, Selma Bensaid, Bora Guvendik, build bot (Jenkins), Krzysztof M Sywula, Patrick Georgi, I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/33625 to look at the new patch set (#5). Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Fix NULL dereference issues found by Klocwork Check if the block pointer bp is Null before dereferencing it. Since assert works only with debug builds, Instead of asserting, return False if bp found as Null Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com> Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 --- M payloads/libpayload/curses/form/fty_alnum.c M payloads/libpayload/curses/form/fty_alpha.c M payloads/libpayload/curses/form/fty_enum.c M payloads/libpayload/curses/form/fty_int.c M src/soc/intel/cannonlake/romstage/fsp_params.c 5 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/33625/5 -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 5 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-MessageType: newpatchset
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 5: (18 comments) https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alnum.c: https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 166: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 166: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alpha.c: https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 166: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 166: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_enum.c: https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 296: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 296: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 297: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 353: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 353: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 354: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 394: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 394: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 395: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_int.c: https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 175: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 175: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/5/payloads/libpayload/curses/form/fty_... PS5, Line 176: return result; please, no spaces at the start of a line -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 5 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-Comment-Date: Fri, 21 Jun 2019 19:21:06 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Hello Pratikkumar V Prajapati, AndreX Andraos, Julius Werner, Selma Bensaid, Bora Guvendik, build bot (Jenkins), Krzysztof M Sywula, Patrick Georgi, I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/33625 to look at the new patch set (#6). Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Fix NULL dereference issues found by Klocwork Check if the block pointer bp is Null before dereferencing it. Since assert works only with debug builds, Instead of asserting, return False if bp found as Null Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com> Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 --- M payloads/libpayload/curses/form/fty_alnum.c M payloads/libpayload/curses/form/fty_alpha.c M payloads/libpayload/curses/form/fty_enum.c M payloads/libpayload/curses/form/fty_int.c M src/soc/intel/cannonlake/romstage/fsp_params.c 5 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/33625/6 -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 6 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-MessageType: newpatchset
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 6: (18 comments) https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alnum.c: https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 166: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 166: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alpha.c: https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 166: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 166: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_enum.c: https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 296: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 296: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 297: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 353: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 353: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 354: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 394: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 394: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 395: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_int.c: https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 175: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 175: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/6/payloads/libpayload/curses/form/fty_... PS6, Line 176: return result; please, no spaces at the start of a line -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 6 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-Comment-Date: Fri, 21 Jun 2019 19:32:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Hello Pratikkumar V Prajapati, AndreX Andraos, Julius Werner, Selma Bensaid, Bora Guvendik, build bot (Jenkins), Krzysztof M Sywula, Patrick Georgi, I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/33625 to look at the new patch set (#7). Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Fix NULL dereference issues found by Klocwork Check if the block pointer bp is Null before dereferencing it. Since assert works only with debug builds, Instead of asserting, return False if bp found as Null Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com> Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 --- M payloads/libpayload/curses/form/fty_alnum.c M payloads/libpayload/curses/form/fty_alpha.c M payloads/libpayload/curses/form/fty_enum.c M payloads/libpayload/curses/form/fty_int.c 4 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/33625/7 -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 7 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-MessageType: newpatchset
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33625 ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Patch Set 7: (18 comments) https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alnum.c: https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 166: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 166: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_alpha.c: https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 166: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 166: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 167: return result; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_enum.c: https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 296: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 296: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 297: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 353: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 353: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 354: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 394: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 394: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 395: return FALSE; please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... File payloads/libpayload/curses/form/fty_int.c: https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 175: if (bp == NULL) please, no spaces at the start of a line https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 175: if (bp == NULL) suspect code indent for conditional statements (2, 4) https://review.coreboot.org/#/c/33625/7/payloads/libpayload/curses/form/fty_... PS7, Line 176: return result; please, no spaces at the start of a line -- To view, visit https://review.coreboot.org/c/coreboot/+/33625 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 7 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-Comment-Date: Fri, 21 Jun 2019 19:34:55 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/33625?usp=email ) Change subject: Fix NULL dereference issues found by Klocwork ...................................................................... Abandoned This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author. -- To view, visit https://review.coreboot.org/c/coreboot/+/33625?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I9ed0fc9b03d9136c582377035cf478d3abf83c41 Gerrit-Change-Number: 33625 Gerrit-PatchSet: 7 Gerrit-Owner: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: AndreX Andraos <andrex.andraos@intel.com> Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com> Gerrit-Reviewer: Duncan L Gerrit-Reviewer: Furquan Shaikh <furquan.m.shaikh@gmail.com> Gerrit-Reviewer: Julius Werner <jwerner@chromium.org> Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula@intel.com> Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com> Gerrit-Reviewer: Thejaswani Putta <thejaswani.putta@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Angel Pons <th3fanbus@gmail.com> Gerrit-CC: Martin L Roth <gaumless@gmail.com> Gerrit-MessageType: abandon
participants (5)
-
Angel Pons (Code Review) -
build bot (Jenkins) (Code Review) -
Martin L Roth (Code Review) -
Pratikkumar V Prajapati (Code Review) -
Thejaswani Putta (Code Review)