This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> +/* 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]