Skip to content
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

[Coverity CID :211511] Dereference after null check in subsys/net/ip/net_if.c #27145

Closed
zephyrbot opened this issue Jul 25, 2020 · 0 comments · Fixed by #27163
Closed

[Coverity CID :211511] Dereference after null check in subsys/net/ip/net_if.c #27145

zephyrbot opened this issue Jul 25, 2020 · 0 comments · Fixed by #27163
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/565a61dd79b0f061056c9b3fe0adba11cbeca6ab/subsys/net/ip/net_if.c#L1081

Category: Null pointer dereferences
Function: rs_timeout
Component: Networking
CID: 211511

Details:

1075             }
1076    
1077             if (!iface) {
1078                 NET_DBG("RS no respond iface %p count %d",
1079                     iface, ipv6->rs_count);
1080                 if (ipv6->rs_count < RS_COUNT) {
>>>     CID 211511:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "iface" to "net_if_start_rs", which dereferences it.
1081                     net_if_start_rs(iface);
1082                 }
1083             } else {
1084                 NET_DBG("Interface IPv6 config %p not found", ipv6);
1085             }
1086    

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Jul 25, 2020
jukkar added a commit to jukkar/zephyr that referenced this issue Jul 27, 2020
The network interface check was invalid when IPv6 Router
Solicitation message was timeout and interface was not found.
This is highly unlikely but needs to be checked properly.

Fixes zephyrproject-rtos#27145
Coverity-CID: 211511

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
carlescufi pushed a commit that referenced this issue Jul 27, 2020
The network interface check was invalid when IPv6 Router
Solicitation message was timeout and interface was not found.
This is highly unlikely but needs to be checked properly.

Fixes #27145
Coverity-CID: 211511

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants