Francois Toguo Fotso has uploaded this change for review. ( https://review.coreboot.org/29045
Change subject: This patch fixes Klockwork issues due to the possibility of a NULL pointer being dereferenced ......................................................................
This patch fixes Klockwork issues due to the possibility of a NULL pointer being dereferenced
Change-Id: Ife366fcb9f8932b39f4a227082c1724e25aa83d1 Signed-off-by: Francois Toguo francois.toguo.fotso@intel.com --- M src/arch/x86/acpigen.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/29045/1
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c index de3d39e..3945670 100644 --- a/src/arch/x86/acpigen.c +++ b/src/arch/x86/acpigen.c @@ -286,6 +286,13 @@ int dotcount = 0, i; int dotpos = 0;
+ /* If we have an incoming NULL namepath Then we need to put a null + name (0x00). */ + if (namepath == NULL) { + acpigen_emit_byte(ZERO_OP); + return; + } + /* We can start with a ''. */ if (namepath[0] == '\') { acpigen_emit_byte('\');