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

Initialize sample buffer pointer with nullptr #27024

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libraries/AP_Compass/CompassCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ extern const AP_HAL::HAL& hal;
///////////////////// PUBLIC INTERFACE /////////////////////
////////////////////////////////////////////////////////////

CompassCalibrator::CompassCalibrator()
CompassCalibrator::CompassCalibrator() :
_sample_buffer(nullptr)
Copy link
Contributor

Choose a reason for hiding this comment

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

For this to be a problem we'd have to have allocated this on the stack, essentially: https://ardupilot.org/dev/docs/style-guide.html#implicit-zeroing-of-memory

Do you still see a problem here?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, in my case it was on the stack. Thank you for the reference. Feel free to close PR then and sorry for the noise.

{
set_status(Status::NOT_STARTED);
}
Expand Down
Loading