dwrite: Fix possible use of uninitialized memory.

If the text source returns fewer than length character, part
of the buffer will be uninitialized.

Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Esme Povirk 2021-12-11 14:04:27 -06:00 committed by Alexandre Julliard
parent 412b36e45a
commit 07fd82cdbd
1 changed files with 1 additions and 1 deletions

View File

@ -865,7 +865,7 @@ static HRESULT get_text_source_ptr(IDWriteTextAnalysisSource *source, UINT32 pos
if (len < length) {
UINT32 read;
*buff = malloc(length * sizeof(WCHAR));
*buff = calloc(length, sizeof(WCHAR));
if (!*buff)
return E_OUTOFMEMORY;
if (*text)