683ae40560
The fuzzer constructs a long, valid nonsense expression (x+x+x-x+x-x, etc.) which exceeds parse depth. At that point, the token stream points to a `+` token. The parser attempts to consume a new statement but stops in `unaryExpression`; this fails again, due to the max parse-depth, but doesn't consume a token. The parser continues trying to parse the statement, but stopping in `unaryExpression`, making no forward progress in an infinite loop. I've made a couple of changes as a result. - Exceeding the max parse depth now sets `fEncounteredFatalError`. - Encountering a fatal error causes block() to immediately halt. This actually undoes a few of the arbitrary changes from http://review.skia.org/506463 but not in a bad way. - `unaryExpression()` now consumes a token before checking parse-depth. - `structDeclaration()` had a similar issue where it could potentially fail without consuming any tokens; this is fixed as well. - Some unnecessarily-nested logic in ternaryExpression() was flattened while I tried to ensure that it always consumes a token. Change-Id: I52c2161965ffbcef1185761ca6897ec1cba5df89 Bug: oss-fuzz:44551 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507436 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com> |
||
---|---|---|
.. | ||
android_fonts | ||
diff_canvas_traces | ||
empty_images | ||
fonts | ||
icc_profiles | ||
images | ||
invalid_images | ||
nima | ||
particles | ||
skottie | ||
sksl | ||
text | ||
Cowboy.svg | ||
crbug769134.fil | ||
nov-talk-sequence.txt | ||
pdf_command_stream.txt | ||
README |
The resources directory includes some third party content used by Skia. Licenses for that code are included in this file. Openclipart Openclipart uses the Creative Commons Zero 1.0 Public Domain License every time an artist uploads a piece of clipart to Openclipart to make it clear the artist is releasing the creative work for anyone to use for any reason, even commercially. This act of "sharing" is the foundation Openclipart is based upon. More details on the license can be found at https://creativecommons.org/publicdomain/zero/1.0/. LGPL or compatible (as implied by inclusion in KDE SVN) http://websvn.kde.org/trunk/tests/ksvgtests/custom/cowboy.svg