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

mmap on expanded files writes beyond allocated memory #10527

Closed
petersalomonsen opened this issue Feb 21, 2020 · 0 comments · Fixed by #10526
Closed

mmap on expanded files writes beyond allocated memory #10527

petersalomonsen opened this issue Feb 21, 2020 · 0 comments · Fixed by #10526

Comments

@petersalomonsen
Copy link
Contributor

petersalomonsen commented Feb 21, 2020

When appending to a file, the buffer size is increased in chunks, and so the actual length of the file could be less than the length of the allocated buffer.

When using mmap on an such a file, content from the over-allocated buffer is being written beyond the allocated memory - causing corruption.

petersalomonsen added a commit to petersalomonsen/emscripten that referenced this issue Feb 21, 2020
fix for not writing buffer contents from expanded files
beyond allocated memory

fixes emscripten-core#10527
petersalomonsen added a commit to petersalomonsen/emscripten that referenced this issue Feb 21, 2020
fix for not writing buffer contents from expanded files
beyond allocated memory

fixes emscripten-core#10527
petersalomonsen added a commit to petersalomonsen/emscripten that referenced this issue Feb 25, 2020
fix for files with buffers larger than the file size
where contents were written beyond memory allocated
for the map

fixes emscripten-core#10527
kripken pushed a commit that referenced this issue Feb 25, 2020
Fix for files with buffers larger than the file size
where contents were written beyond memory allocated
for the map.

fixes #10527
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 a pull request may close this issue.

1 participant