Fixed zero sized allocation.

This commit is contained in:
Armin Novak 2018-11-29 11:07:46 +01:00
parent 7ec9e942fb
commit d975fd0452
1 changed files with 6 additions and 0 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)