Merge pull request #5941 from akallabeth/clang_fixes

Fixed clang scanbuild warnings.
This commit is contained in:
Martin Fleisz 2020-03-04 09:34:51 +01:00 committed by GitHub
commit 6942669f32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -794,7 +794,7 @@ static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, const B
UINT8 cbChId;
UINT8 cbLen;
unsigned long chunkLength;
UINT status;
UINT status = CHANNEL_RC_BAD_INIT_HANDLE;
if (!drdynvc)
return CHANNEL_RC_BAD_CHANNEL_HANDLE;

View File

@ -1096,7 +1096,10 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, D
switch (event)
{
case CHANNEL_EVENT_DATA_RECEIVED:
if (!rdpsnd || (rdpsnd->OpenHandle != openHandle))
if (!rdpsnd)
return;
if (rdpsnd->OpenHandle != openHandle)
{
WLog_ERR(TAG, "%s error no match", rdpsnd_is_dyn_str(rdpsnd->dynamic));
return;
@ -1239,7 +1242,10 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event_ex(LPVOID lpUserParam, L
UINT error = CHANNEL_RC_OK;
rdpsndPlugin* plugin = (rdpsndPlugin*)lpUserParam;
if (!plugin || (plugin->InitHandle != pInitHandle))
if (!plugin)
return;
if (plugin->InitHandle != pInitHandle)
{
WLog_ERR(TAG, "%s error no match", rdpsnd_is_dyn_str(plugin->dynamic));
return;

View File

@ -314,7 +314,9 @@ static int ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash)
if (memcmp(context->NtlmV2Hash, NTLM_NULL_BUFFER, 16) != 0)
return 1;
if (memcmp(context->NtlmHash, NTLM_NULL_BUFFER, 16) != 0)
if (!credentials)
return -1;
else if (memcmp(context->NtlmHash, NTLM_NULL_BUFFER, 16) != 0)
{
NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User,
credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain,