[coreboot-gerrit] Change in coreboot[master]: This patch fixes Klockwork issues due to the possibility of a NULL po...

Francois Toguo Fotso (Code Review) gerrit at coreboot.org
Thu Oct 11 20:25:53 CEST 2018


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 at 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('\\');

-- 
To view, visit https://review.coreboot.org/29045
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife366fcb9f8932b39f4a227082c1724e25aa83d1
Gerrit-Change-Number: 29045
Gerrit-PatchSet: 1
Gerrit-Owner: Francois Toguo Fotso <francois.toguo.fotso at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181011/c2ca3032/attachment.html>


More information about the coreboot-gerrit mailing list