[PATCH][BZ #14806] Fix stack overflow in getaddrinfo() if host has many addresses.

Ondřej Bílka neleai@seznam.cz
Thu May 30 15:21:00 GMT 2013


> +/* The list of IPv6 addresses is usually very short but on some systems, it
> +   can be very long (thousands of entries). So we want the implementation to
> +   be fast for short lists but able to handle arbitrary length. Therefore we
> +   keep one block of IN6AI_FIXED_SIZE entries on the stack and a linked list
> +   of blocks of IN6AI_CHUNK_SIZE entries allocated by malloc() */

Is there external pointer to in6addrinfo structures? 
If not then doubling allocated amount is simpler to write and faster.



More information about the Libc-alpha mailing list