Skip to content
Snippets Groups Projects
Commit 6690d556 authored by philmd's avatar philmd Committed by Marc-André Lureau
Browse files

Remove alloca() call in get_dns_addr_resolv_conf()


The ALLOCA(3) man-page mentions its "use is discouraged".

For now get_dns_addr_resolv_conf() is called with pointer to
a in_addr/in6_addr structure, and its size. Declare a union
of these structures on the stack, able to hold both of them.
This allows us to remove the alloca() call, keeping the buffer
on the stack.

Add an assertion in the unlikely case another inet address
is handled by this function.

Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210507133212.1952121-1-philmd@redhat.com>
parent 4e6444e8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment