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 :198866]Null pointer dereferences in /subsys/net/lib/dns/llmnr_responder.c #16581

Closed
aasthagr opened this issue Jun 3, 2019 · 1 comment · Fixed by #16699
Closed
Assignees
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: medium Medium impact/importance bug

Comments

@aasthagr
Copy link
Collaborator

aasthagr commented Jun 3, 2019

Static code scan issues seen in File: /subsys/net/lib/dns/llmnr_responder.c
Category: Null pointer dereferences
Function: create_ipv6_dst_addr
Component: Networking
CID: 198866
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@aasthagr aasthagr added area: Networking bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Jun 3, 2019
@aasthagr
Copy link
Collaborator Author

aasthagr commented Jun 3, 2019

*** CID 198866:  Null pointer dereferences  (NULL_RETURNS)
/subsys/net/lib/dns/llmnr_responder.c: 73 in create_ipv6_dst_addr()
67     {
68     	struct net_udp_hdr *udp_hdr, hdr;
69     
70     	udp_hdr = net_udp_get_hdr(pkt, &hdr);
71     
72     	addr->sin6_family = AF_INET6;
>>>     CID 198866:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a null pointer "udp_hdr".
73     	addr->sin6_port = udp_hdr->src_port;
74     
75     	net_ipaddr_copy(&addr->sin6_addr, &NET_IPV6_HDR(pkt)->src);
76     }
77     #endif
78     

@nashif nashif added the priority: medium Medium impact/importance bug label Jun 4, 2019
jukkar added a commit to jukkar/zephyr that referenced this issue Jun 7, 2019
It is possible that UDP header cannot be accessed so we need
to check that we do not do null pointer dereference.

Coverity-CID: 198866
Fixes zephyrproject-rtos#16581

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
backporting bot pushed a commit that referenced this issue Jun 8, 2019
It is possible that UDP header cannot be accessed so we need
to check that we do not do null pointer dereference.

Coverity-CID: 198866
Fixes #16581

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
jukkar added a commit that referenced this issue Jun 8, 2019
It is possible that UDP header cannot be accessed so we need
to check that we do not do null pointer dereference.

Coverity-CID: 198866
Fixes #16581

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
nashif pushed a commit that referenced this issue Jun 11, 2019
It is possible that UDP header cannot be accessed so we need
to check that we do not do null pointer dereference.

Coverity-CID: 198866
Fixes #16581

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
area: Networking bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants