termptyesc: fix bug found by tyfuzz

This commit is contained in:
Boris Faure 2018-10-17 22:54:24 +02:00
parent 5e06ee1d78
commit df81992e90
1 changed files with 6 additions and 0 deletions

View File

@ -1840,6 +1840,12 @@ _handle_hyperlink(Termpty *ty,
/* /!\ we expect ';' and ':' to be escaped in params */
end = memchr(s+1, ';', len);
if (!end)
{
ERR("invalid hyperlink escape code: missing ';'"
" (len:%d s:%.*s)", len, len, s);
goto end;
}
*end = '\0';
do
{