Skip to content

[Coverity CID :216792] Out-of-bounds access in tests/net/lib/dns_addremove/src/main.c #31677

@zephyrbot

Description

@zephyrbot

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/f91e9fba51e5da46ee5c6822f8656713d74a6ecf/tests/net/lib/dns_addremove/src/main.c#L232

Category: Memory - corruptions
Function: test_dns_add_callback6
Component: Tests
CID: 216792

Details:

226         struct dns_resolve_context *dnsCtx = &resv_ipv6;
227         const char *dns_servers_str[] = { DNS_NAME_IPV6, NULL };
228         int ret;
229    
230         dns_resolve_close(dnsCtx);
231    
>>>     CID 216792:  Memory - corruptions  (OVERRUN)
>>>     Overrunning struct type dns_resolve_context of 144 bytes by passing it to a function which accesses it at byte offset 207.
232         ret = dns_resolve_init(dnsCtx, dns_servers_str, NULL);
233         if (ret < 0) {
234             LOG_ERR("dns_resolve_init fail (%d)", ret);
235             return;
236         }
237    

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.

Metadata

Metadata

Labels

CoverityA Coverity detected issue or its fixbugThe 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