-
Notifications
You must be signed in to change notification settings - Fork 3k
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
PPPinterface: remove faulty address getter check for invalid pointer #11975
PPPinterface: remove faulty address getter check for invalid pointer #11975
Conversation
@michalpasztamobica, thank you for your changes. |
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.
API does NOT permit a NULL, therefore you should NOT check for null.
This causes broken code to continue running, when it should have crashed.
3552ea7
to
193fd80
Compare
193fd80
to
ecc89c9
Compare
@SeppoTakalo , I see your point and I now simply removed the faulty check. Please, review again. |
Why API was then defined with a pointer parameter? A reference would have been more safe in that case. |
Yes, reference would be safer, but does not leave any glue that this parameter is going to be modified, also feels more natural for C developers. Therefore using pointers is a dominant in Mbed OS. |
In my experience, references aren't really much "safer", but they do serve as documentation that null isn't acceptable. It's still quite easy to generate null references that crash in exactly the same way. They do at least block you from literally doing
(And if something like that did happen, I would rather |
CI started |
Aborted CI, 5.15 jobs need to get first in |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Summary of change
(edited after Seppo's remark)
PPPInterface
address getter had reversed logic of the check - this is fixed now, by removing the check entirely.Documentation
Pull request type
Test results
Reviewers
@kivaisan