Skip to content

Conversation

@suifengersan123
Copy link


Basic Info

Info Please fill out this column
Ticket(s) this addresses (add tickets here #5707)

Description of contribution in a few bullet points

I applied the same repair logic from the previous PR (#5707) to the main branch.

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

Comment on lines 149 to 156
KinematicParameters* ptr = kinematics_.load();
// Check for nullptr before dereferencing
if (ptr == nullptr) {
throw std::runtime_error(
"KinematicsHandler::getKinematics() called before kinematics_ is initialized");
}
return *ptr;
}
Copy link
Member

Choose a reason for hiding this comment

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

The intends here are incorrect for the code styping

Comment on lines 59 to 61
if (ptr != nullptr) {
delete ptr;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why is this indented?

Comment on lines 157 to 161
KinematicParameters* ptr = kinematics_.load();
if (ptr == nullptr) {
return; // Nothing to update
}
KinematicParameters kinematics(*ptr);
Copy link
Member

Choose a reason for hiding this comment

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

ALl this is incorrect too

Comment on lines 242 to 246
KinematicParameters* ptr = kinematics_.load();
if (ptr == nullptr) {
return; // Nothing to update
}
KinematicParameters kinematics(*ptr);
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Comment on lines 297 to 301
KinematicParameters* new_kinematics = new KinematicParameters(kinematics);
KinematicParameters* old_kinematics = kinematics_.exchange(new_kinematics);

if (old_kinematics != nullptr) {
delete old_kinematics;
}
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

@SteveMacenski
Copy link
Member

There's some linting problems here that needs resolution - CI also picked up on some of them. Also look at the DCO sign off.

@suifengersan123 suifengersan123 changed the title fix bug UAF fix bug UAF Signed-off-by: suifengersan123 <[email protected]> Nov 27, 2025
@suifengersan123 suifengersan123 changed the title fix bug UAF Signed-off-by: suifengersan123 <[email protected]> fix bug UAF Nov 27, 2025
@suifengersan123 suifengersan123 force-pushed the main branch 3 times, most recently from d1d24ec to 9a8157d Compare November 27, 2025 13:33
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.

2 participants