[NTUSER] Check class name existence on IntGetAtomFromStringOrAtom (#6184)

Based on I_Kill_Bugs' class_error.patch.
JIRA issue: CORE-13422, CORE-7531, CORE-18639
This commit is contained in:
Katayama Hirofumi MZ 2024-01-10 08:01:37 +09:00 committed by GitHub
parent 8b5c5fb913
commit 9a9b22aac1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;