[PATCH 2/3] dwrite: Fix possible use of uninitialized memory.
11 Dec
2021
11 Dec
'21
8:04 p.m.
If the text source returns fewer than length character, part of the buffer will be uninitialized. Signed-off-by: Esme Povirk <esme(a)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) -- 2.25.1
1466
Age (days ago)
1468
Last active (days ago)
1 comments
2 participants
participants (2)
-
Esme Povirk -
Nikolay Sivov