This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #14806] Fix stack overflow in getaddrinfo() if host has many addresses.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Michal Kubecek <mkubecek at suse dot cz>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 30 May 2013 17:18:41 +0200
- Subject: Re: [PATCH][BZ #14806] Fix stack overflow in getaddrinfo() if host has many addresses.
- References: <20130530135411 dot B8F9062C80 at unicorn dot suse dot cz>
> +/* 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.