libc/iconv: find_alias was mis-computing remaining alias table length

This caused the strnstr to walk off the end of the alias array and
fetch invalid data. Instead of attempting to update 'len', just
re-compute it based on the table end pointer that is already known.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard via Newlib 2020-07-09 16:58:47 -07:00 committed by Corinna Vinschen
parent 2c33d31fa8
commit 24f3c61953
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ search_again:
&& (p+l == table_end || isspace (*(p+l)) || *(p+l) == '\n')))
{
ptable = p + l;
len -= table - p;
len = table_end - ptable;
goto search_again;
}