From d823586c3eace80e91555c2a33706f449f207c68 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 21 Dec 2017 15:16:24 +0100 Subject: [PATCH] Fixed parallel channel argument checks --- channels/parallel/client/parallel_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/channels/parallel/client/parallel_main.c b/channels/parallel/client/parallel_main.c index b8c818041..0b0b14685 100644 --- a/channels/parallel/client/parallel_main.c +++ b/channels/parallel/client/parallel_main.c @@ -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])