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

Fix NULL pointer in pdal translate --polygon #740

Merged
merged 1 commit into from
Feb 1, 2015

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Feb 1, 2015

The crop_stage was being initialized to a (zero literal) NULL pointer, and was never updated to a real Stage *. This led to a segfault when trying to crop to a polygon with pdal translate (and probably would cause segfaults in other situations as well).

Rather than creating a StageFactory in a third place in the same method, I just made a method-wide stage factory — losing possible efficiency in favor of simplicity.

This patch does not include any unit tests, since AFICT there aren't any unit tests for kernels.

The crop_stage was being initialized to a (zero literal) NULL pointer,
and was never updated to a real Stage *. This led to a segfault when
trying to crop to a polygon with `pdal translate` (and probably would
cause segfaults in other situations as well).

Rather than creating a StageFactory in a third place in the same method,
I just made a method-wide stage factory — losing possible efficiency in
favor of simplicity.

This patch does not include any unit tests, since AFICT there aren't any
unit tests for kernels.
hobu added a commit that referenced this pull request Feb 1, 2015
Fix NULL pointer in `pdal translate --polygon`
@hobu hobu merged commit e8df5e6 into PDAL:master Feb 1, 2015
@gadomski gadomski deleted the translate-crop-null-stage-ptr branch February 1, 2015 17:39
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.

None yet

2 participants