Skip to content

Fixed out-of-range memory accesses#2

Open
user40 wants to merge 2 commits intoDevreeseJorik:mainfrom
user40:main
Open

Fixed out-of-range memory accesses#2
user40 wants to merge 2 commits intoDevreeseJorik:mainfrom
user40:main

Conversation

@user40
Copy link
Contributor

@user40 user40 commented Mar 1, 2023

Accessing memory out of range, such as during a game restart, can fill the lua console with error messages and slow down the frame rate.
To avoid this I added a check of the address in advance before reading the memory.

Copy link
Owner

@DevreeseJorik DevreeseJorik left a comment

Choose a reason for hiding this comment

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

Would you mind also adding these checks for the Memory:write and GetByteRange methods? I can also do it myself. We can merge it once that's done.

@user40
Copy link
Contributor Author

user40 commented Mar 6, 2023

Okay, I'll do it.

@user40
Copy link
Contributor Author

user40 commented Mar 6, 2023

I Added boundary checks to Memory:write* and Memory:getByteRange*.
They also do nothing or return 0 for meaningless addresses. Do you prefer other error handles?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments