From 224b1cc286122b8aca5002fec31ed0390b299403 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 26 Sep 2016 07:42:24 +0200 Subject: Fix various issues reported by Coverity --- DcsInt/DcsInt.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'DcsInt') diff --git a/DcsInt/DcsInt.c b/DcsInt/DcsInt.c index 3fe90d6..46398c9 100644 --- a/DcsInt/DcsInt.c +++ b/DcsInt/DcsInt.c @@ -826,7 +826,9 @@ OnExit( retValue = AsciiStrDecimalToUintn(exitStatusStr); } - OnExitGetParam(action, "file", NULL, &fileStr); + if (!OnExitGetParam(action, "file", NULL, &fileStr)) { + fileStr = NULL; + } if (OnExitGetParam(action, "printinfo", NULL, NULL)) { @@ -863,12 +865,18 @@ OnExit( EfiCpuHalt(); } // Try to exec - res = EfiExec(h, fileStr); - if (EFI_ERROR(res)) { - ERR_PRINT(L"\nStart %s - %r\n", fileStr, res); + if (fileStr != NULL) { + res = EfiExec(h, fileStr); + if (EFI_ERROR(res)) { + ERR_PRINT(L"\nStart %s - %r\n", fileStr, res); + EfiCpuHalt(); + } + } + else { + ERR_PRINT(L"\nNo EFI execution path specified. Halting!\n"); EfiCpuHalt(); } - } + } if (fileStr != NULL) { EfiSetVar(L"DcsExecCmd", NULL, fileStr, (StrLen(fileStr) + 1) * 2, EFI_VARIABLE_BOOTSERVICE_ACCESS); -- cgit v1.2.3