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'.
This commit is contained in:
Danyil Blyschak 2024-05-21 11:15:45 -05:00 committed by Alexandre Julliard
parent 3ee6f3b918
commit d28d7bd52c

View file

@ -1017,7 +1017,7 @@ static HRESULT WINAPI filestream_CopyTo(IStream *iface, IStream *dest, ULARGE_IN
/* Write */ /* Write */
hr = IStream_Write(dest, buff, read_chunk, &written_chunk); hr = IStream_Write(dest, buff, read_chunk, &written_chunk);
if (written_chunk) if (written)
written->QuadPart += written_chunk; written->QuadPart += written_chunk;
if (FAILED(hr) || written_chunk != left) if (FAILED(hr) || written_chunk != left)
break; break;