Skip to content

Commit

Permalink
Prevent possible double-free in ares_getaddrinfo() if ares_destroy() …
Browse files Browse the repository at this point in the history
…is called

In the event that ares_destroy() is called prior to ares_getaddrinfo() completing,
it would result in an invalid read and double-free due to calling end_hquery() twice.

Reported By: Jann Horn @ Google Project Zero
  • Loading branch information
bradh352 committed May 7, 2020
1 parent 1c73ecc commit 1cc7e83
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ares_getaddrinfo.c
Expand Up @@ -548,6 +548,7 @@ static void host_callback(void *arg, int status, int timeouts,
else if (status == ARES_EDESTRUCTION)
{
end_hquery(hquery, status);
return;
}

if (!hquery->remaining)
Expand Down

0 comments on commit 1cc7e83

Please sign in to comment.