Re: [PATCH 1/2] main: Accept interface names as a parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 10, 2016 at 11:04:25AM -0700, Tim Kourt wrote:
> The introduction of a parameter ‘-i’ to override the value of
> ‘interface’ attribute in hostapd.conf files. This change enables
> the reuse of the configuration files for the concurrent instances
> of hostapd. An ability to dynamically assign the interface names
> simplifies the usages of hostapd service in the automated
> emulations of the wireless environments.

Thanks, both patches applied. I fixed some issues with this first patch:

> +	if (if_name) {
> +		strncpy(iface->conf->bss[0]->iface, if_name, strlen(if_name));
> +		iface->conf->bss[0]->iface[strlen(if_name)] = '\0';
> +	}

Should use os_strlcpy() instead of strncpy() and especially that
strlen(if_name) part would make this not do any bounds checking on the
destination, i.e., this would allow buffer write overflow from the
command line.

> +		*if_names = os_realloc_array(*if_names, ++(*if_names_size),
> +					     sizeof(char *));

realloc functions cannot be used in that manner cleanly, i.e., this
would leak memory if realloc returns NULL. A temporary variable is
needed to allow the original (and still allocated) pointer to be freed
in case of such a failure.
 
-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux