https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5d9f622eeb6859ddfdd23…
commit 5d9f622eeb6859ddfdd236693dbd96b868d5f612
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Dec 25 08:22:08 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Dec 25 08:22:08 2023 +0900
[SHLWAPI] Fix SHCreateMemStream corner case (#6224)
When the system run out of memory,
check NULL and fail elegantly if
necessary.
This doesn't fix CORE-19229 but I
think it needs a fix.
CORE-19229
---
dll/win32/shlwapi/regstream.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dll/win32/shlwapi/regstream.c b/dll/win32/shlwapi/regstream.c
index 63615d3d9cf..39889705014 100644
--- a/dll/win32/shlwapi/regstream.c
+++ b/dll/win32/shlwapi/regstream.c
@@ -669,6 +669,10 @@ IStream * WINAPI SHCreateMemStream(const BYTE *lpbData, UINT
dwDataLen)
if (!strm)
HeapFree(GetProcessHeap(), 0, lpbDup);
}
+#ifdef __REACTOS__
+ if (!strm)
+ return NULL;
+#endif
return &strm->IStream_iface;
}