VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/DcsInt
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-09-26 07:42:24 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-17 18:17:47 +0200
commit224b1cc286122b8aca5002fec31ed0390b299403 (patch)
tree589a728a9a554361df23389350802d8871ec16f3 /DcsInt
parent5fb01149ef1cecc36b261094b304ff0654bb7ae3 (diff)
downloadVeraCrypt-DCS-224b1cc286122b8aca5002fec31ed0390b299403.tar.gz
VeraCrypt-DCS-224b1cc286122b8aca5002fec31ed0390b299403.zip
Fix various issues reported by Coverity
Diffstat (limited to 'DcsInt')
-rw-r--r--DcsInt/DcsInt.c18
1 files changed, 13 insertions, 5 deletions
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);