Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48148 )
Change subject: src/acpi/acpigen: Add NULL pointer check ......................................................................
src/acpi/acpigen: Add NULL pointer check
Add NULL pointer check in acpigen_emit_namestring to avoid segmentation fault.
Change-Id: I3d01d28e74f202278b5a5a96d2edd45c66f10883 Signed-off-by: Ronak Kanabar ronak.kanabar@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/48148 Reviewed-by: Subrata Banik subrata.banik@intel.com Reviewed-by: Maulik V Vaghela maulik.v.vaghela@intel.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/acpi/acpigen.c 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Subrata Banik: Looks good to me, approved Maulik V Vaghela: Looks good to me, approved
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 244ac54..9a5543d 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -291,6 +291,10 @@ int dotcount = 0, i; int dotpos = 0;
+ /* Check for NULL pointer */ + if (!namepath) + return; + /* We can start with a ''. */ if (namepath[0] == '\') { acpigen_emit_byte('\');