*/
static UINT dvcman_init(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChannelMgr)
{
- size_t i;
+ int i;
DVCMAN* dvcman = (DVCMAN*)pChannelMgr;
UINT error = CHANNEL_RC_OK;
static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChannelMgr,
UINT32 ChannelId, const char* ChannelName)
{
- size_t i;
+ int i;
BOOL bAccept;
DVCMAN_CHANNEL* channel;
DrdynvcClientContext* context;
static UINT drdynvc_virtual_channel_event_attached(drdynvcPlugin* drdynvc)
{
UINT error = CHANNEL_RC_OK;
- size_t i;
+ int i;
DVCMAN* dvcman;
if (!drdynvc)
static UINT drdynvc_virtual_channel_event_detached(drdynvcPlugin* drdynvc)
{
UINT error = CHANNEL_RC_OK;
- size_t i;
+ int i;
DVCMAN* dvcman;
if (!drdynvc)
if (MsConfig)
MsOutSize = MsConfig->MsOutSize;
- if (MsOutSize > SIZE_MAX - 36)
- return ERROR_INVALID_DATA;
-
if (MsOutSize > 0)
+ {
+ if ((size_t)MsOutSize > SIZE_MAX - 36)
+ return ERROR_INVALID_DATA;
+
out_size = 36 + MsOutSize;
+ }
else
out_size = 44;
if ((ret <= 0) || (ret <= 4) || (slen <= 4) || (locale != LIBUSB_DT_STRING) ||
(ret > UINT8_MAX))
{
- char* msg = "SHORT_DESCRIPTOR";
+ const char* msg = "SHORT_DESCRIPTOR";
if (ret < 0)
msg = libusb_error_name(ret);
WLog_Print(urbdrc->log, WLOG_DEBUG,
sprintf_s(deviceLocation, sizeof(deviceLocation),
"Port_#%04" PRIu8 ".Hub_#%04" PRIu8 "", device_address, bus_number);
- len = strnlen(deviceLocation, MIN(sizeof(deviceLocation), inSize - 1));
+ len = strnlen(deviceLocation,
+ MIN(sizeof(deviceLocation), (inSize > 0) ? inSize - 1U : 0));
for (i = 0; i < len; i++)
text[i] = (WCHAR)deviceLocation[i];
text[len++] = '\0';
{
size_t pos = 0;
UINT32 y;
+ WINPR_UNUSED(planeLength);
+
if (!plane || !deltaPlane)
return FALSE;
{
INT32 delta = *srcPtr - *prevLinePtr;
s2c = (delta >= 0) ? (char)delta : (char)(~((BYTE)(-delta)) + 1);
- s2c = (s2c >= 0) ? ((UINT32)s2c << 1) : (char)(((UINT32)(~((BYTE)s2c) + 1) << 1) - 1);
+ s2c = (s2c >= 0) ? (char)((UINT32)s2c << 1)
+ : (char)(((UINT32)(~((BYTE)s2c) + 1) << 1) - 1);
*outPtr = (BYTE)s2c;
}
}
static BOOL rdg_read_http_unicode_string(wStream* s, WCHAR** string, UINT16* lengthInBytes)
{
- WCHAR* str;
+ union {
+ BYTE* b;
+ WCHAR* w;
+ } str;
UINT16 strLenBytes;
/* Read length of the string */
Stream_Read_UINT16(s, strLenBytes);
/* Remember position of our string */
- Stream_GetPointer(s, str);
+ Stream_GetPointer(s, str.b);
/* seek past the string - if this fails something is wrong */
if (!Stream_SafeSeek(s, strLenBytes))
/* return the string data (if wanted) */
if (string)
- *string = str;
+ *string = str.w;
if (lengthInBytes)
*lengthInBytes = strLenBytes;
if (fieldsPresent & HTTP_TUNNEL_RESPONSE_FIELD_SOH_REQ)
{
- UINT16 certLen;
-
/* Seek over nonce (20 bytes) */
if (!Stream_SafeSeek(s, 20))
{
}
static BOOL update_decompress_brush(wStream* s, BYTE* output, size_t outSize, BYTE bpp)
{
- INT32 x, y, k;
+ size_t x, k;
+ INT8 y;
BYTE byte = 0;
const BYTE* palette = Stream_Pointer(s) + 16;
- const INT32 bytesPerPixel = ((bpp + 1) / 8);
+ const size_t bytesPerPixel = ((bpp + 1) / 8);
if (Stream_GetRemainingLength(s) < 16 + bytesPerPixel * 4)
return FALSE;
if (!input || (length < 0) || (exponent_size < 0) || !modulus || !exponent || !output)
return -1;
- if (exponent_size > SIZE_MAX / 2)
+ if ((size_t)exponent_size > SIZE_MAX / 2)
return -1;
if (key_length >= SIZE_MAX / 2 - exponent_size)
return -1;
bufferSize = 2ULL * key_length + exponent_size;
- if (length > bufferSize)
- bufferSize = length;
+ if ((size_t)length > bufferSize)
+ bufferSize = (size_t)length;
input_reverse = (BYTE*)calloc(bufferSize, 1);
goto fail;
crypto_reverse(output, output_length);
- if (output_length < key_length)
+ if ((UINT32)output_length < key_length)
memset(output + output_length, 0, key_length - output_length);
fail:
wStream* s;
socket = capture_plugin_get_socket(pdata);
- if (socket == -1)
+ if ((INT64)socket == -1LL)
return FALSE;
s = capture_plugin_packet_new(SESSION_END_PDU_BASE_SIZE, MESSAGE_TYPE_SESSION_END);
return TRUE;
socket = capture_plugin_get_socket(pdata);
- if (socket == -1)
+ if ((INT64)socket == -1LL)
return FALSE;
if (!capture_plugin_send_frame(pc, socket, gdi->primary_buffer))
rdpSettings* settings = pc->context.settings;
socket = capture_plugin_init_socket();
- if (socket == -1)
+ if ((INT64)socket == -1LL)
{
WLog_ERR(TAG, "failed to establish a connection");
return FALSE;