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: 236604] Untrusted value as argument in subsys/net/lib/lwm2m/lwm2m_engine.c #36315

Closed
zephyrbot opened this issue Jun 16, 2021 · 1 comment
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:/zephyrproject-rtos/zephyr/tree/d25e5c20a07203443b2e9fafe30bf8eef852ed23/subsys/net/lib/lwm2m/lwm2m_engine.c#L4601

Category: Insecure data handling
Function: socket_recv_message
Component: Networking
CID: 236604

Details:

lwm2m_udp_receive(client_ctx, in_buf, len, &from_addr, handle_request);

4595         if (len == 0) {
4596             LOG_ERR("Zero length recv");
4597             return 0;
4598         }
4599    
4600         in_buf[len] = 0U;
>>>     CID 236604:  Insecure data handling  (TAINTED_SCALAR)
>>>     Passing tainted expression "in_buf" to "lwm2m_udp_receive", which uses it as an offset.
4601         lwm2m_udp_receive(client_ctx, in_buf, len, &from_addr, handle_request);
4602    
4603         return 0;
4604     }
4605    
4606     static int socket_send_message(struct lwm2m_ctx *client_ctx)

For more information about the violation, check the Coverity Reference. CWE-20

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.

@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 Jun 16, 2021
@rlubos
Copy link
Contributor

rlubos commented Jun 17, 2021

False positive, similar case to #33040.

@rlubos rlubos closed this as completed Jun 17, 2021
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

No branches or pull requests

2 participants