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:
parent
412b36e45a
commit
07fd82cdbd
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue