[psaux] Avoid slow PS font parsing in case of error.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9955

* src/psaux/psobjs.c (ps_parser_to_bytes): Set `parser->cursor' even
in case of error to avoid potential re-scanning.
This commit is contained in:
Werner Lemberg 2018-08-18 14:39:20 +02:00
parent 2550fc75a5
commit 4dc0d48f7b
2 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,15 @@
2018-08-14 Werner Lemberg <wl@gnu.org>
2018-08-18 Werner Lemberg <wl@gnu.org>
[psaux] Avoid slow PS font parsing in case of error.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9955
* src/psaux/psobjs.c (ps_parser_to_bytes): Set `parser->cursor' even
in case of error to avoid potential re-scanning.
2018-08-18 Werner Lemberg <wl@gnu.org>
[cff] Fix heap buffer overflow in old engine.

View File

@ -1447,6 +1447,8 @@
bytes,
max_bytes );
parser->cursor = cur;
if ( delimiters )
{
if ( cur < parser->limit && *cur != '>' )
@ -1456,11 +1458,9 @@
goto Exit;
}
cur++;
parser->cursor++;
}
parser->cursor = cur;
Exit:
return error;
}