If the text source returns fewer than length character, part of the buffer will be uninitialized.
Signed-off-by: Esme Povirk esme@codeweavers.com --- dlls/dwrite/analyzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 8ecfad5f3a5..92a02f8d3aa 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -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)