-
Notifications
You must be signed in to change notification settings - Fork 77
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
EvseV2G/IsoMux: check if if_name is nullptr #925
Conversation
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.
looks good to me
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.
See comments. I dont know if these checks are necessary
@@ -112,6 +112,10 @@ int check_interface(struct v2g_context* v2g_ctx) { | |||
v2g_ctx->if_name = choose_first_ipv6_interface(); | |||
} | |||
|
|||
if (v2g_ctx->if_name == nullptr) { |
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.
In line 125 there is already a check if if_name == nulltpr
. So the segfault is happening in line 119 (mreq.ipv6mr_interface = if_nametoindex(v2g_ctx->if_name);
) ?
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.
exactly
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.
strcmp call needs to be protected
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.
looks good to me
This can happen if there are no interfaces with IPv6 addresses and would lead to a segfault later on Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
6c56e7d
to
82c617d
Compare
This can happen if there are no interfaces with IPv6 addresses and would lead to a segfault later on
Describe your changes
Issue ticket number and link
Checklist before requesting a review