https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a9b22aac1279c69b2d1c…
commit 9a9b22aac1279c69b2d1c373093ca64251d71077
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Jan 10 08:01:37 2024 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Jan 10 08:01:37 2024 +0900
[NTUSER] Check class name existence on IntGetAtomFromStringOrAtom (#6184)
Based on I_Kill_Bugs' class_error.patch.
JIRA issue: CORE-13422, CORE-7531, CORE-18639
---
win32ss/user/ntuser/class.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/win32ss/user/ntuser/class.c b/win32ss/user/ntuser/class.c
index 548bef255e6..1ad90351265 100644
--- a/win32ss/user/ntuser/class.c
+++ b/win32ss/user/ntuser/class.c
@@ -1355,9 +1355,17 @@ IntGetAtomFromStringOrAtom(
}
else
{
- ASSERT(IS_ATOM(ClassName->Buffer));
- *Atom = (RTL_ATOM)((ULONG_PTR)ClassName->Buffer);
- Ret = TRUE;
+ if (ClassName->Buffer)
+ {
+ *Atom = (RTL_ATOM)((ULONG_PTR)ClassName->Buffer);
+ Ret = TRUE;
+ }
+ else
+ {
+ *Atom = 0;
+ EngSetLastError(ERROR_CLASS_DOES_NOT_EXIST);
+ Ret = FALSE;
+ }
}
return Ret;