Skip to content

[Coverity CID: 220541] Dereference before null check in subsys/net/lib/capture/capture.c #34000

@zephyrbot

Description

@zephyrbot

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/b86f7addae05add0db45d9b528854235fbb93a48/subsys/net/lib/capture/capture.c#L342

Category: Null pointer dereferences
Function: net_capture_setup
Component: Networking
CID: 220541

Details:

if (remote_iface == NULL) {

336         } else {
337             NET_ERR("Invalid address family %d", remote.sa_family);
338             ret = -EINVAL;
339             goto fail;
340         }
341    
>>>     CID 220541:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "remote_iface" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
342         if (remote_iface == NULL) {
343             NET_ERR("Remote address %s unreachable", remote_addr);
344             ret = -ENETUNREACH;
345             goto fail;
346         }
347    

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v29271/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.

Metadata

Metadata

Assignees

Labels

CoverityA Coverity detected issue or its fixarea: NetworkingbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions