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

Added missing 8 bytes to compressed binary pcd length. #2281

Merged
merged 1 commit into from
Apr 17, 2018

Conversation

floriankramer
Copy link
Contributor

@floriankramer floriankramer commented Apr 16, 2018

When compressed binary pcd files are read the size passed to mmap for memory mapping the file is 8 bytes to small, as the size of the two four byte unsigned integers used to store the uncompressed and compressed size of the data in the pcd file are not added to the total size. This can lead to a segfault, when the size of a pcd file is at most 8 bytes smaller than the next multiple of the page size of the virtual address space and if the next page after the last page used by mmap is not owned by the process.

@taketwo
Copy link
Member

taketwo commented Apr 16, 2018

Do you think #2261 is related?

@floriankramer
Copy link
Contributor Author

I tried the steps you described in the issue with the patched version and was not able to reproduce the crash.
The compressed file is also 4112384 bytes large, which is 4096 * 1004 so it would fall into the category of files that should be affected by the bug (As the very last byte read would be in the next page, if I understand it properly).

@taketwo taketwo merged commit 87d5547 into PointCloudLibrary:master Apr 17, 2018
@taketwo taketwo mentioned this pull request Apr 17, 2018
@taketwo
Copy link
Member

taketwo commented Apr 17, 2018

Thanks for the patch! Can confirm that that bug is solved.

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

Successfully merging this pull request may close these issues.

3 participants