diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/location/client/location_main.c | 8 | ||||
-rw-r--r-- | channels/rail/client/rail_main.c | 2 | ||||
-rw-r--r-- | channels/rail/server/rail_main.c | 25 | ||||
-rw-r--r-- | channels/rdpdr/client/rdpdr_main.c | 16 | ||||
-rw-r--r-- | channels/remdesk/client/remdesk_main.c | 2 |
5 files changed, 27 insertions, 26 deletions
diff --git a/channels/location/client/location_main.c b/channels/location/client/location_main.c index 281070f..df6b82e 100644 --- a/channels/location/client/location_main.c +++ b/channels/location/client/location_main.c @@ -110,7 +110,7 @@ static UINT location_channel_send(IWTSVirtualChannel* channel, wStream* s) static UINT location_send_client_ready_pdu(const LOCATION_CALLBACK* callback) { wStream sbuffer = { 0 }; - char buffer[32] = { 0 }; + BYTE buffer[32] = { 0 }; wStream* s = Stream_StaticInit(&sbuffer, buffer, sizeof(buffer)); WINPR_ASSERT(s); @@ -210,7 +210,7 @@ static UINT location_send_base_location3d(IWTSVirtualChannel* channel, const RDPLOCATION_BASE_LOCATION3D_PDU* pdu) { wStream sbuffer = { 0 }; - char buffer[32] = { 0 }; + BYTE buffer[32] = { 0 }; wStream* s = Stream_StaticInit(&sbuffer, buffer, sizeof(buffer)); WINPR_ASSERT(s); WINPR_ASSERT(channel); @@ -251,7 +251,7 @@ static UINT location_send_location2d_delta(IWTSVirtualChannel* channel, const RDPLOCATION_LOCATION2D_DELTA_PDU* pdu) { wStream sbuffer = { 0 }; - char buffer[32] = { 0 }; + BYTE buffer[32] = { 0 }; wStream* s = Stream_StaticInit(&sbuffer, buffer, sizeof(buffer)); WINPR_ASSERT(s); @@ -287,7 +287,7 @@ static UINT location_send_location3d_delta(IWTSVirtualChannel* channel, const RDPLOCATION_LOCATION3D_DELTA_PDU* pdu) { wStream sbuffer = { 0 }; - char buffer[32] = { 0 }; + BYTE buffer[32] = { 0 }; wStream* s = Stream_StaticInit(&sbuffer, buffer, sizeof(buffer)); WINPR_ASSERT(s); diff --git a/channels/rail/client/rail_main.c b/channels/rail/client/rail_main.c index c5828c1..3878807 100644 --- a/channels/rail/client/rail_main.c +++ b/channels/rail/client/rail_main.c @@ -112,7 +112,7 @@ UINT rail_send_channel_data(railPlugin* rail, wStream* src) */ static UINT rail_client_execute(RailClientContext* context, const RAIL_EXEC_ORDER* exec) { - char* exeOrFile = NULL; + const char* exeOrFile = NULL; UINT error = 0; railPlugin* rail = NULL; UINT16 flags = 0; diff --git a/channels/rail/server/rail_main.c b/channels/rail/server/rail_main.c index 8e38c2b..5089646 100644 --- a/channels/rail/server/rail_main.c +++ b/channels/rail/server/rail_main.c @@ -650,7 +650,7 @@ static UINT rail_read_client_status_order(wStream* s, RAIL_CLIENT_STATUS_ORDER* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_read_exec_order(wStream* s, RAIL_EXEC_ORDER* exec) +static UINT rail_read_exec_order(wStream* s, RAIL_EXEC_ORDER* exec, char* args[]) { RAIL_EXEC_ORDER order = { 0 }; UINT16 exeLen = 0; @@ -671,30 +671,31 @@ static UINT rail_read_exec_order(wStream* s, RAIL_EXEC_ORDER* exec) if (exeLen > 0) { const SSIZE_T len = exeLen / sizeof(WCHAR); - exec->RemoteApplicationProgram = Stream_Read_UTF16_String_As_UTF8(s, len, NULL); + exec->RemoteApplicationProgram = args[0] = Stream_Read_UTF16_String_As_UTF8(s, len, NULL); if (!exec->RemoteApplicationProgram) goto fail; } if (workLen > 0) { const SSIZE_T len = workLen / sizeof(WCHAR); - exec->RemoteApplicationWorkingDir = Stream_Read_UTF16_String_As_UTF8(s, len, NULL); + exec->RemoteApplicationWorkingDir = args[1] = + Stream_Read_UTF16_String_As_UTF8(s, len, NULL); if (!exec->RemoteApplicationWorkingDir) goto fail; } if (argLen > 0) { const SSIZE_T len = argLen / sizeof(WCHAR); - exec->RemoteApplicationArguments = Stream_Read_UTF16_String_As_UTF8(s, len, NULL); + exec->RemoteApplicationArguments = args[2] = Stream_Read_UTF16_String_As_UTF8(s, len, NULL); if (!exec->RemoteApplicationArguments) goto fail; } return CHANNEL_RC_OK; fail: - free(exec->RemoteApplicationProgram); - free(exec->RemoteApplicationArguments); - free(exec->RemoteApplicationWorkingDir); + free(args[0]); + free(args[1]); + free(args[2]); *exec = order; return ERROR_INTERNAL_ERROR; } @@ -948,12 +949,14 @@ static UINT rail_recv_client_client_status_order(RailServerContext* context, static UINT rail_recv_client_exec_order(RailServerContext* context, wStream* s) { UINT error = 0; + char* args[3] = { 0 }; RAIL_EXEC_ORDER exec = { 0 }; if (!context || !s) return ERROR_INVALID_PARAMETER; - if ((error = rail_read_exec_order(s, &exec))) + error = rail_read_exec_order(s, &exec, args); + if (error) { WLog_ERR(TAG, "rail_read_client_status_order failed with error %" PRIu32 "!", error); return error; @@ -964,9 +967,9 @@ static UINT rail_recv_client_exec_order(RailServerContext* context, wStream* s) if (error) WLog_ERR(TAG, "context.Exec failed with error %" PRIu32 "", error); - free(exec.RemoteApplicationProgram); - free(exec.RemoteApplicationArguments); - free(exec.RemoteApplicationWorkingDir); + free(args[0]); + free(args[1]); + free(args[2]); return error; } diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 2ffa951..8cbb359 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1861,7 +1861,7 @@ UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) UINT status = 0; rdpdrPlugin* plugin = (rdpdrPlugin*)rdpdr; - if (!rdpdr || !s) + if (!s) { Stream_Release(s); return CHANNEL_RC_NULL_DATA; @@ -1870,16 +1870,14 @@ UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) if (!plugin) { Stream_Release(s); - status = CHANNEL_RC_BAD_INIT_HANDLE; - } - else - { - const size_t pos = Stream_GetPosition(s); - rdpdr_dump_send_packet(rdpdr->log, WLOG_TRACE, s, "[rdpdr-channel] send"); - status = plugin->channelEntryPoints.pVirtualChannelWriteEx( - plugin->InitHandle, plugin->OpenHandle, Stream_Buffer(s), pos, s); + return CHANNEL_RC_BAD_INIT_HANDLE; } + const size_t pos = Stream_GetPosition(s); + rdpdr_dump_send_packet(rdpdr->log, WLOG_TRACE, s, "[rdpdr-channel] send"); + status = plugin->channelEntryPoints.pVirtualChannelWriteEx( + plugin->InitHandle, plugin->OpenHandle, Stream_Buffer(s), pos, s); + if (status != CHANNEL_RC_OK) { Stream_Release(s); diff --git a/channels/remdesk/client/remdesk_main.c b/channels/remdesk/client/remdesk_main.c index 1d39ed1..269e9a8 100644 --- a/channels/remdesk/client/remdesk_main.c +++ b/channels/remdesk/client/remdesk_main.c @@ -69,7 +69,7 @@ static UINT remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* s) */ static UINT remdesk_generate_expert_blob(remdeskPlugin* remdesk) { - char* name = NULL; + const char* name = NULL; char* pass = NULL; const char* password = NULL; rdpSettings* settings = NULL; |