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

thdat: fix wrong thtk_io_map() usage in th02_read() and th02_write() #119

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

FOTMarut
Copy link
Contributor

@FOTMarut FOTMarut commented May 12, 2024

thtk_io_map() creates a read-only memory mapping, but both th02_read() and th02_write() perform writes to the data buffer. This immediately segfaults (well actually it doesn't, because mmap always fails, but that's another story).
This commit fixes it so thtk_io_pread() is used directly instead.

thtk_io_map() creates a read-only memory mapping, but th02_read()
performs writes to the data buffer. This immediately segfaults (well
actually it doesn't, because mmap always fails, but that's another
story).
This commit fixes it so thtk_io_pread() is used directly instead.
@FOTMarut FOTMarut marked this pull request as draft May 12, 2024 18:44
@FOTMarut FOTMarut marked this pull request as ready for review May 12, 2024 19:22
@FOTMarut FOTMarut changed the title thdat: fix wrong thtk_io_map() usage in th02_read() thdat: fix wrong thtk_io_map() usage in th02_read() and th02_write() May 12, 2024
@DankRank
Copy link
Member

DankRank commented Dec 7, 2024

whoops, I completely forgot about this PR, and only remembered after I fixed the issue myself 😅

I'm still gonna merge this, because this is better than my solution

DankRank added a commit that referenced this pull request Dec 7, 2024
This reverts commit eae5642.

PR #119 fixes this in a better way
@DankRank DankRank merged commit 93ed316 into thpatch:master Dec 7, 2024
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