diff --git a/pdf.c b/pdf.c index eae4b047abc483461bd361038a190391e396f3c5..2cb5cd9c9ec6fff53023b4cd524afa4c917090d8 100644 --- a/pdf.c +++ b/pdf.c @@ -1169,11 +1169,13 @@ act_rldstring(const HParseResult *p, void *u) /* * The following functions implement a fix for being able to exhaust memory by nesting strings, objects and dicts too deeply. - * A counter in aux for each type is incremented on each opening token, and decremented on each closing token. The counter is not decremented when it is 0 to avoid underflow. - * - * The counter is global across the document (but respects document structure, e.g. parentheses in streams don't count, unless for some reason they're parsed with the lparen rule.) - * The validations make the parse fail if this nesting depth is exceeded. Because currently there are no diagnostic messages, this can probably result in unexpected parses. + * A counter in aux (separately for each type of nesting) is incremented on each opening token, and decremented on each closing token. + * The counters are not decremented when it is 0 to avoid underflow. * + * The counters are global across the document (but respect document structure, + * e.g. parentheses in streams don't count, unless for some reason they're parsed with the lparen rule.) + * The validations make the parse fail if this nesting depth is exceeded. + * Because currently there are no diagnostic messages, this can probably result in unexpected parses. */ #define PAREN_MAX_NEST_DEPTH 256