Skip to content

Commit

Permalink
Fixed parallel channel argument checks
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Dec 21, 2017
1 parent 04708b3 commit d823586
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions channels/parallel/client/parallel_main.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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])
Expand Down

0 comments on commit d823586

Please sign in to comment.