-
Notifications
You must be signed in to change notification settings - Fork 428
Prevent segfault in PyKDL when asking for nonexisting segment of chain #228
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: master
Are you sure you want to change the base?
Changes from 2 commits
3663023
6eb2246
7fdc4e4
0816b90
4c9b0af
8698e70
114bad4
ceb57a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,8 +251,15 @@ public: | |
|
||
unsigned int getNrOfJoints()const; | ||
unsigned int getNrOfSegments()const; | ||
|
||
const Segment& getSegment(unsigned int nr)const /Factory/; | ||
|
||
const Segment* getSegment(unsigned int nr)const /Factory/; | ||
%MethodCode | ||
if (a0 < 0 || a0 >= (unsigned int)sipCpp->getNrOfSegments()) { | ||
PyErr_SetString(PyExc_IndexError, "Chain index out of range"); | ||
return 0; | ||
} | ||
sipRes = &(sipCpp->getSegment(a0)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I am not sure if this is valid in SIP. The Why did you change the return type from Could anybody who is more proficient with SIP could jump in (@smits)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not mean to change the return type, that must have slipped in while I was testing, good catch. |
||
%End | ||
|
||
}; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.