Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ZERICO2005
Copy link
Contributor

@ZERICO2005 ZERICO2005 commented Nov 7, 2025

memset((void*)0xFFFFFF, ch, 0), non-TICE bzero((void*)0xFFFFFF, 0), and wmemset((wchar_t*)0xFFFFFF, ch, 0) all had bugs that would write to ~16777215 bytes of memory since the size == 0 check would fail when the dst pointer is 0xFFFFFF, since (0xFFFFFF + 1) + (0x000000 - 1) doesn't set the carry flag.

I have fixed these functions so that they will never write anything when size == 0.
__TICE__ bzero may still read one byte if size == 0, but that should probably be okay.

@ZERICO2005 ZERICO2005 merged commit 7a29d99 into master Nov 10, 2025
9 checks passed
@ZERICO2005 ZERICO2005 deleted the fix_memset branch November 10, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant