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

Tries to fix a scenario when a user sends a malformed point cloud #494

Merged
merged 8 commits into from
Oct 13, 2022

Conversation

arjo129
Copy link
Contributor

@arjo129 arjo129 commented Oct 6, 2022

🦟 Bug fix

Fixes #

Summary

This PR fixes a rather odd bug. Essentially if a user were to malform a pointcloud by claiming the point cloud to contain only "x,y,z" fields but has a datasize larger than that, the condition iterX == iterX.End() && iterY == iterY.End() && iterZ == iterZ.End(); does not get met. Thus the system will keep iterating till a segfault comes along. This PR enforces better check to make sure we do not segfault.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@arjo129 arjo129 requested a review from jennuine as a code owner October 6, 2022 07:51
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Oct 6, 2022
@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Merging #494 (e610455) into gz-gui7 (0d754ab) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           gz-gui7     #494      +/-   ##
===========================================
- Coverage    67.82%   67.77%   -0.05%     
===========================================
  Files           44       44              
  Lines         4826     4829       +3     
===========================================
  Hits          3273     3273              
- Misses        1553     1556       +3     
Impacted Files Coverage Δ
src/plugins/point_cloud/PointCloud.cc 16.58% <0.00%> (-0.24%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

codecov wants tests :)

src/plugins/point_cloud/PointCloud.cc Show resolved Hide resolved
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
@arjo129 arjo129 force-pushed the arjo/fix/handle_malformed_message branch from d325a7a to 656c190 Compare October 11, 2022 12:52
src/plugins/point_cloud/PointCloud.cc Outdated Show resolved Hide resolved
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
@arjo129 arjo129 force-pushed the arjo/fix/handle_malformed_message branch from e7145a7 to e610455 Compare October 13, 2022 05:34
@arjo129 arjo129 enabled auto-merge (squash) October 13, 2022 05:35
@arjo129 arjo129 merged commit 33adb18 into gz-gui7 Oct 13, 2022
@arjo129 arjo129 deleted the arjo/fix/handle_malformed_message branch October 13, 2022 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants