[PATCH 1/9] libc/inet/resolv.c: fix segfault while reading /etc/hosts.

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Oct 31 14:43:13 UTC 2012


On Fri, Sep 21, 2012 at 05:29:11PM +0200, Florian Fainelli wrote:
> From: Felix Fietkau <nbd at openwrt.org>

config_read memsets the space needed for the tokens already.
Can you provide an /etc/hosts and a call that triggers this, please?

TIA,
> 
> Signed-off-by: Felix Fietkau <nbd at openwrt.org>
> ---
>  libc/inet/resolv.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
> index f1e7da7..fff2794 100644
> --- a/libc/inet/resolv.c
> +++ b/libc/inet/resolv.c
> @@ -1630,6 +1630,7 @@ int __read_etc_hosts_r(
>  	 * struct in[6]_addr
>  	 * char line_buffer[BUFSZ+];
>  	 */
> +	memset(buf, 0, buflen);
>  	parser->data = buf;
>  	parser->data_len = aliaslen;
>  	parser->line_len = buflen - aliaslen;
> -- 
> 1.7.9.5
> 
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc


More information about the uClibc mailing list