On Tue, 28 Apr 2020 00:47:38 +0800 Phil Yang <phil.y...@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.