Skip to content
Snippets Groups Projects
Commit 30c23d28 authored by Rom Walton's avatar Rom Walton
Browse files

VBOX: Check for a valid Console pointer before attempting to pause/resume the VM.

get_Console() is not returning an error, bit the returning IConsole interface is NULL.  Just return an ERR_EXEC instead of crash.
parent cb61af8f
No related branches found
No related tags found
No related merge requests found
...@@ -1516,10 +1516,12 @@ int VBOX_VM::pause() { ...@@ -1516,10 +1516,12 @@ int VBOX_VM::pause() {
if (CHECK_ERROR(rc)) goto CLEANUP; if (CHECK_ERROR(rc)) goto CLEANUP;
// Pause the machine. // Pause the machine.
if (pConsole) {
rc = pConsole->Pause(); rc = pConsole->Pause();
if (CHECK_ERROR(rc)) goto CLEANUP; if (CHECK_ERROR(rc)) goto CLEANUP;
retval = BOINC_SUCCESS; retval = BOINC_SUCCESS;
}
CLEANUP: CLEANUP:
return retval; return retval;
...@@ -1543,10 +1545,12 @@ int VBOX_VM::resume() { ...@@ -1543,10 +1545,12 @@ int VBOX_VM::resume() {
if (CHECK_ERROR(rc)) goto CLEANUP; if (CHECK_ERROR(rc)) goto CLEANUP;
// Resume the machine. // Resume the machine.
if (pConsole) {
rc = pConsole->Resume(); rc = pConsole->Resume();
if (CHECK_ERROR(rc)) goto CLEANUP; if (CHECK_ERROR(rc)) goto CLEANUP;
retval = BOINC_SUCCESS; retval = BOINC_SUCCESS;
}
CLEANUP: CLEANUP:
return retval; return retval;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment