Fixed parallel channel argument checks

This commit is contained in:
Armin Novak 2017-12-21 15:16:24 +01:00
parent 04708b37e1
commit d823586c3e
1 changed files with 5 additions and 5 deletions

View File

@ -375,8 +375,8 @@ static UINT parallel_free(DEVICE* device)
UINT error;
PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device;
if (MessageQueue_PostQuit(parallel->queue, 0)
&& (WaitForSingleObject(parallel->thread, INFINITE) == WAIT_FAILED))
if (!MessageQueue_PostQuit(parallel->queue, 0)
|| (WaitForSingleObject(parallel->thread, INFINITE) == WAIT_FAILED))
{
error = GetLastError();
WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error);
@ -405,7 +405,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
{
char* name;
char* path;
int i;
size_t i;
size_t length;
RDPDR_PARALLEL* device;
PARALLEL_DEVICE* parallel;
@ -414,10 +414,10 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
name = device->Name;
path = device->Path;
if (!name || (name[0] == '*'))
if (!name || (name[0] == '*') || !path)
{
/* TODO: implement auto detection of parallel ports */
return CHANNEL_RC_OK;
return CHANNEL_RC_INITIALIZATION_ERROR;
}
if (name[0] && path[0])