From d28d7bd52cfb8f98835d4792901c12785b3bf0b3 Mon Sep 17 00:00:00 2001 From: Danyil Blyschak Date: Tue, 21 May 2024 11:15:45 -0500 Subject: [PATCH] shcore: Check optional pointer in filestream_CopyTo() before writing to it. Check that the 'written' parameter in this function is non-null before incrementing it by 'written_chunk'. --- dlls/shcore/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c index a64b6661d23..58ddda3fb2a 100644 --- a/dlls/shcore/main.c +++ b/dlls/shcore/main.c @@ -1017,7 +1017,7 @@ static HRESULT WINAPI filestream_CopyTo(IStream *iface, IStream *dest, ULARGE_IN /* Write */ hr = IStream_Write(dest, buff, read_chunk, &written_chunk); - if (written_chunk) + if (written) written->QuadPart += written_chunk; if (FAILED(hr) || written_chunk != left) break;