[dpdk-dev] [PATCH] trace: fix build with gcc 10

Stephen Hemminger stephen at networkplumber.org
Mon Apr 27 18:58:36 CEST 2020


On Tue, 28 Apr 2020 00:47:38 +0800
Phil Yang <phil.yang at arm.com> wrote:

> -	if (strlen(optarg) >= size) {
> +	/* the specified trace directory name cannot
> +	 * exceed PATH_MAX-1.
> +	 */
> +	if (strlen(optarg) >= (size - 1)) {
>  		trace_err("input string is too big");

strnlen() is useful for these kinds of cases.


More information about the dev mailing list