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

Code issues flagged by Polaris static analyzer #35

Open
jmiltner opened this issue May 7, 2024 · 2 comments
Open

Code issues flagged by Polaris static analyzer #35

jmiltner opened this issue May 7, 2024 · 2 comments

Comments

@jmiltner
Copy link

jmiltner commented May 7, 2024

We got the following issues flagged in a Polaris analyzer scan of our source code, which includes swift-async-dns-resolver (version 0.3.1). (The issues are in the imported module c-ares, but since this code is included via swift-async-dns-resolver, we're reporting this here...)

(1) Out-of-bounds access to a buffer in ares__addrinfo2hostent.c:166:
This is caused by inconsistent comparison of the "family" variable value against "AF_INET" vs. "AF_INET6".

(2) Dereference after null check in ares_getaddrinfo.c:828:
Comparing "hquery->name" to null implies that "hquery->name" might be null. But code continues to dereference "hquery->name" in the for loop stop condition.

(3) Logically dead code in ares_parse_uri_reply.c:155:
In line 155, the value of "status" cannot be != ARES_SUCCESS

(4) Logically dead code in ares__readaddrinfo.c:200:
In line 200, the value of "status" cannot be != ARES_SUCCESS

(5) Logically dead code in ares_parse_caa_reply.c:169:
In line 169, the value of "status" cannot be != ARES_SUCCESS

@Lukasa
Copy link

Lukasa commented May 7, 2024

Please don't report this here: report it to c-ares. We're not going to carry patches to c-ares.

@jmiltner
Copy link
Author

jmiltner commented May 7, 2024

It looks like the issues are already resolved in c-ares latest sources, so this is in fact an issue for this project, as it will need to include a newer version of c-ares to get those problems resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants