[PATCH] hostapd: fix interfaces.iface initialization

Jouni Malinen j at w1.fi
Fri Apr 15 11:14:34 EDT 2011


On Tue, Apr 12, 2011 at 11:45:42AM +0300, Guy Eilam wrote:
> Set all the interfaces.iface pointers to NULL after
> the allocation of that memory block for cases those
> pointers are accessed during each of the interfaces
> initialization process (hostapd_interface_init()).
> One example for such case is during WPS initialization when
> the code tries to fetch the uuid from each of the interfaces.

Thanks!

> +	/*
> +	 * interfaces.iface pointers should first be initialized to NULL
> +	 * for cases that use hostapd_for_each_interface during
> +	 * the interface initialization process
> +	 */
> +	os_memset(interfaces.iface, 0,
> +		interfaces.count * sizeof(struct hostapd_iface *));

It is simple to just replace os_malloc with os_zalloc to avoid need for
this extra call here and that is what I changed this into for the
commit.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list