Merge pull request #5080 from akallabeth/scanbuild-ex-warn

Scanbuild ex warn
This commit is contained in:
David Fort 2018-11-29 16:24:28 +01:00 committed by GitHub
commit 7ad24b6069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 1 deletions

View File

@ -796,6 +796,9 @@ CACHE_GLYPH_ORDER* copy_cache_glyph_order(rdpContext* context, const CACHE_GLYPH
if (glyph->unicodeCharacters)
{
if (glyph->cGlyphs == 0)
goto fail;
dst->unicodeCharacters = calloc(glyph->cGlyphs, sizeof(WCHAR));
if (!dst->unicodeCharacters)
@ -855,6 +858,9 @@ CACHE_GLYPH_V2_ORDER* copy_cache_glyph_v2_order(rdpContext* context,
if (glyph->unicodeCharacters)
{
if (glyph->cGlyphs == 0)
goto fail;
dst->unicodeCharacters = calloc(glyph->cGlyphs, sizeof(WCHAR));
if (!dst->unicodeCharacters)

View File

@ -339,7 +339,7 @@ BOOL planar_decompress(BITMAP_PLANAR_CONTEXT* planar,
UINT32 rawWidths[4];
UINT32 rawHeights[4];
BYTE FormatHeader;
const BYTE* planes[4];
const BYTE* planes[4] = { 0 };
const UINT32 w = MIN(nSrcWidth, nDstWidth);
const UINT32 h = MIN(nSrcHeight, nDstHeight);
const primitives_t* prims = primitives_get();

View File

@ -1394,11 +1394,17 @@ BOOL license_answer_license_request(rdpLicense* license)
license->EncryptedHardwareId->type = BB_ENCRYPTED_DATA_BLOB;
if (!license_encrypt_and_MAC(license, license->HardwareId, HWID_LENGTH, license->EncryptedHardwareId, signature))
{
free(license_data);
return FALSE;
}
calBlob = license_new_binary_blob(BB_DATA_BLOB);
if (!calBlob)
{
free(license_data);
return FALSE;
}
calBlob->data = license_data;
calBlob->length = license_size;

View File

@ -1257,6 +1257,9 @@ void nego_enable_ext(rdpNego* nego, BOOL enable_ext)
BOOL nego_set_routing_token(rdpNego* nego, BYTE* RoutingToken, DWORD RoutingTokenLength)
{
if (RoutingTokenLength == 0)
return FALSE;
free(nego->RoutingToken);
nego->RoutingTokenLength = RoutingTokenLength;
nego->RoutingToken = (BYTE*) malloc(nego->RoutingTokenLength);

View File

@ -2098,6 +2098,9 @@ static CACHE_BITMAP_V2_ORDER* update_read_cache_bitmap_v2_order(rdpUpdate* updat
if (Stream_GetRemainingLength(s) < cache_bitmap_v2->bitmapLength)
goto fail;
if (cache_bitmap_v2->bitmapLength == 0)
goto fail;
cache_bitmap_v2->bitmapDataStream = malloc(cache_bitmap_v2->bitmapLength);
if (!cache_bitmap_v2->bitmapDataStream)