[COV] folder_select buffer overrun

Change-Id: I441e1fa13d3832b3b12e3f46f35ef63fb3c1de02
This commit is contained in:
William Wilgus 2022-03-18 08:42:57 -04:00
parent b309fae2bc
commit a13ae2afd5

View file

@ -516,7 +516,7 @@ static int select_paths(struct folder* root, const char* filenames)
sstr = lastfnp;
lastfnp = fnp;
if (len <= 0 || len > buflen)
if (len <= 0 || len + 1 >= buflen)
continue;
strlcpy(buf, sstr, len + 1);
struct child *item = find_from_filename(buf, root);