-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix bug UAF #5720
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
base: main
Are you sure you want to change the base?
fix bug UAF #5720
Conversation
| 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; | ||
| } |
There was a problem hiding this comment.
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
| if (ptr != nullptr) { | ||
| delete ptr; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this indented?
| KinematicParameters* ptr = kinematics_.load(); | ||
| if (ptr == nullptr) { | ||
| return; // Nothing to update | ||
| } | ||
| KinematicParameters kinematics(*ptr); |
There was a problem hiding this comment.
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
| KinematicParameters* ptr = kinematics_.load(); | ||
| if (ptr == nullptr) { | ||
| return; // Nothing to update | ||
| } | ||
| KinematicParameters kinematics(*ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
| KinematicParameters* new_kinematics = new KinematicParameters(kinematics); | ||
| KinematicParameters* old_kinematics = kinematics_.exchange(new_kinematics); | ||
|
|
||
| if (old_kinematics != nullptr) { | ||
| delete old_kinematics; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
|
There's some linting problems here that needs resolution - CI also picked up on some of them. Also look at the DCO sign off. |
d1d24ec to
9a8157d
Compare
Signed-off-by: suifengersan123 <[email protected]>
….com> Signed-off-by: suifengersan123 <[email protected]>
….com> Signed-off-by: suifengersan123 <[email protected]>
….com> Signed-off-by: suifengersan123 <[email protected]>
….com> Signed-off-by: suifengersan123 <[email protected]>
….com> Signed-off-by: suifengersan123 <[email protected]>
….com> Signed-off-by: suifengersan123 <[email protected]>
Signed-off-by: suifengersan123 <[email protected]>
5395f9c to
7d9c6e6
Compare
Basic Info
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:
backport-*.