https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8add40e893c4bbbb7221…
commit d8add40e893c4bbbb72211cae3e351445e53a3f4
Author: jimtabor <james.tabor(a)reactos.org>
AuthorDate: Sat Mar 28 14:03:15 2020 -0500
Commit: jimtabor <james.tabor(a)reactos.org>
CommitDate: Sat Mar 28 14:03:15 2020 -0500
[User32] Fix null return.
See CORE-16769.
---
win32ss/user/user32/windows/window.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/win32ss/user/user32/windows/window.c b/win32ss/user/user32/windows/window.c
index 40f051d3b6d..60c9feb47f5 100644
--- a/win32ss/user/user32/windows/window.c
+++ b/win32ss/user/user32/windows/window.c
@@ -159,16 +159,18 @@ RtlGetExpWinVer( HMODULE hModule )
if ( hModule && !((ULONG_PTR)hModule >> 16))
{
pinth = RtlImageNtHeader( hModule );
-
- dwMajorVersion = pinth->OptionalHeader.MajorSubsystemVersion;
-
- if ( dwMajorVersion == 1 )
- {
- dwMajorVersion = 3;
- }
- else
+ if ( pinth )
{
- dwMinorVersion = pinth->OptionalHeader.MinorSubsystemVersion;
+ dwMajorVersion = pinth->OptionalHeader.MajorSubsystemVersion;
+
+ if ( dwMajorVersion == 1 )
+ {
+ dwMajorVersion = 3;
+ }
+ else
+ {
+ dwMinorVersion = pinth->OptionalHeader.MinorSubsystemVersion;
+ }
}
}
return MAKELONG(MAKEWORD(dwMinorVersion, dwMajorVersion), 0);