Skip to content

Adds a check for when CreateFileMappingA fails - #2146

Merged
SergioRAgostinho merged 2 commits into
PointCloudLibrary:masterfrom
StephenNneji:master
Dec 13, 2017
Merged

Adds a check for when CreateFileMappingA fails#2146
SergioRAgostinho merged 2 commits into
PointCloudLibrary:masterfrom
StephenNneji:master

Conversation

@StephenNneji

Copy link
Copy Markdown
Contributor

CreateFileMappingA returns a NULL handle when it fails for example due to insufficient disk space which leads to a crash when memcpy tries to access the map.

CreateFileMappingA returns a NULL handle when it fails for example due to insufficient disk space which leads to a crash when memcpy tries to access the map.
@SergioRAgostinho SergioRAgostinho added the needs: code review Specify why not closed/merged yet label Dec 12, 2017
Comment thread io/include/pcl/io/impl/pcd_io.hpp Outdated
HANDLE fm = CreateFileMappingA (h_native_file, NULL, PAGE_READWRITE, 0, (DWORD) (data_idx + data_size), NULL);
if (fm == NULL)
{
throw pcl::IOException("[pcl::PCDWriter::writeBinary] Error during write ()!");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Modify the error message to indicate that there was an error during memory map creation.

@SergioRAgostinho

Copy link
Copy Markdown
Member

👍 Thanks.

@SergioRAgostinho SergioRAgostinho added needs: author reply Specify why not closed/merged yet and removed needs: code review Specify why not closed/merged yet labels Dec 13, 2017
@SergioRAgostinho SergioRAgostinho removed the needs: author reply Specify why not closed/merged yet label Dec 13, 2017
@SergioRAgostinho
SergioRAgostinho merged commit 98fc222 into PointCloudLibrary:master Dec 13, 2017
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