*** buffer overflow detected ***: terminated points to ares_fds

Cristian Rodríguez crrodriguez at opensuse.org
Mon Jan 3 22:26:01 CET 2022


>
> nfds = ares_fds(channel, &read_fds, &write_fds);
>
> I don't understand how this is a buffer overflow as the function call only
> uses locally initialised variables. Here is the full function:
>
> static void wait_ar
>
>     struct timevaes(ares_channel channel)
> {l *tvp, tv;
>     fd_set read_fds, write_fds;
>     int nfds;
>
>     FD_ZERO(&read_fds);
>     FD_ZERO(&write_fds);
>     nfds = ares_fds(channel, &read_fds, &write_fds);
>
>     if (nfds > 0) {
>     tvp = ares_timeout(channel, NULL, &tv);
>     select(nfds, &read_fds, &write_fds, NULL, tvp);
>     ares_process(channel, &read_fds, &write_fds);
>     }
> }
>


 fd >= FD_SETSIZE is undefined behaviour., glibc is being nice to you, it
could as well shatter the universe into pieces.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.haxx.se/pipermail/c-ares/attachments/20220103/cf9a7565/attachment.htm>


More information about the c-ares mailing list