mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
@@ -457,7 +457,7 @@ static UINT rdpdr_process_client_name_request(pf_channel_server_context* rdpdr,
|
||||
return ERROR_INVALID_DATA;
|
||||
|
||||
Stream_Read_UINT32(s, unicodeFlag);
|
||||
rdpdr->common.computerNameUnicode = (unicodeFlag & 1);
|
||||
rdpdr->common.computerNameUnicode = ((unicodeFlag & 1) != 0) ? TRUE : FALSE;
|
||||
|
||||
Stream_Read_UINT32(s, codePage);
|
||||
WINPR_UNUSED(codePage); /* Field is ignored */
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include <limits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
@@ -332,7 +333,13 @@ static BOOL dump_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata, vo
|
||||
WLog_ERR(TAG, "Could not write to stream");
|
||||
return FALSE;
|
||||
}
|
||||
stream.write(buffer, Stream_Length(data->data));
|
||||
const auto s = Stream_Length(data->data);
|
||||
if (s > std::numeric_limits<std::streamsize>::max())
|
||||
{
|
||||
WLog_ERR(TAG, "Stream length %" PRIuz " exceeds std::streamsize::max", s);
|
||||
return FALSE;
|
||||
}
|
||||
stream.write(buffer, static_cast<std::streamsize>(s));
|
||||
if (stream.fail())
|
||||
{
|
||||
WLog_ERR(TAG, "Could not write to stream");
|
||||
|
||||
@@ -94,8 +94,8 @@ PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE*
|
||||
UINT32 flags, size_t totalSize)
|
||||
{
|
||||
PfChannelResult result = PF_CHANNEL_RESULT_ERROR;
|
||||
BOOL firstPacket = (flags & CHANNEL_FLAG_FIRST);
|
||||
BOOL lastPacket = (flags & CHANNEL_FLAG_LAST);
|
||||
BOOL firstPacket = (flags & CHANNEL_FLAG_FIRST) != 0;
|
||||
BOOL lastPacket = (flags & CHANNEL_FLAG_LAST) != 0;
|
||||
|
||||
WINPR_ASSERT(tracker);
|
||||
|
||||
|
||||
@@ -73,7 +73,10 @@ BOOL shadow_client_audin_init(rdpShadowClient* client)
|
||||
|
||||
if (client->subsystem->audinFormats)
|
||||
{
|
||||
if (!audin_server_set_formats(client->audin, client->subsystem->nAudinFormats,
|
||||
if (client->subsystem->nAudinFormats > SSIZE_MAX)
|
||||
goto fail;
|
||||
|
||||
if (!audin_server_set_formats(client->audin, (SSIZE_T)client->subsystem->nAudinFormats,
|
||||
client->subsystem->audinFormats))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -804,7 +804,8 @@ static BOOL shadow_server_create_certificate(rdpShadowServer* server, const char
|
||||
if (!makecert)
|
||||
goto out_fail;
|
||||
|
||||
if (makecert_context_process(makecert, makecert_argc, makecert_argv) < 0)
|
||||
WINPR_ASSERT(makecert_argc <= INT_MAX);
|
||||
if (makecert_context_process(makecert, (int)makecert_argc, makecert_argv) < 0)
|
||||
goto out_fail;
|
||||
|
||||
if (makecert_context_set_output_file_name(makecert, "shadow") != 1)
|
||||
|
||||
Reference in New Issue
Block a user