diff mbox

[U-Boot,v2,3/5] efi_loader: parameter check efi_convert_device_path_to_text

Message ID 20170713205135.1538-4-xypron.glpk@gmx.de
State Superseded
Delegated to: Alexander Graf
Headers show

Commit Message

Heinrich Schuchardt July 13, 2017, 8:51 p.m. UTC
Do not dereference NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v2
	no change
---
 lib/efi_loader/efi_device_path_to_text.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index c6ac5e52f3..a5ea63300b 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -36,6 +36,11 @@  uint16_t *efi_convert_device_path_to_text(
 	efi_status_t r;
 	uint16_t *buffer = NULL;
 
+	if (!device_path) {
+		EFI_EXIT(EFI_INVALID_PARAMETER);
+		return NULL;
+	}
+
 	switch (device_path->type) {
 	case DEVICE_PATH_TYPE_MESSAGING_DEVICE:
 		switch (device_path->sub_type) {