Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(developer): verify context(n) offsets are valid in kmcmplib #13308

Draft
wants to merge 2 commits into
base: beta
Choose a base branch
from

Conversation

mcdurdin
Copy link
Member

Add validity checks to kmcmplib to verify that offsets provided to context(n) are in range for the context, and do not point to non-character elements (nul and if) in the context string.

Fixes: #13301
Fixes: #13302
Relates-to: #13299
Relates-to: #13276

@keymanapp-test-bot skip

Add validity checks to kmcmplib to verify that offsets provided to
`context(n)` are in range for the context, and do not point to
non-character elements (`nul` and `if`) in the context string.

Fixes: #13301
Fixes: #13302
Relates-to: #13299
Relates-to: #13276
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Feb 21, 2025

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@@ -2267,7 +2277,9 @@ KMX_DWORD GetXStringImpl(PKMX_WCHAR tstr, PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX
}
int n1b;
n1b = atoiW(q);
if (n1b < 1 || n1b >= 0xF000) return KmnCompilerMessages::ERROR_InvalidToken;
if (n1b < 1 || n1b >= 0xF000) {
return KmnCompilerMessages::ERROR_ContextExHasInvalidOffset;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clearer error message, no functional change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
1 participant