Skip to content

Commit 2d5ff34

Browse files
Avoid erroring on known exceptions in tomllib.py (#20)
It may raise exceptions other than `TOMLDecodeError`.
1 parent 1e97542 commit 2d5ff34

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tomllib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import tomllib
22

3+
POSSIBLE_EXCEPTIONS = (KeyError, RecursionError, tomllib.TOMLDecodeError,
4+
TypeError, ValueError)
5+
36
def FuzzerRunOne(FuzzerInput):
47
try:
58
tomllib.loads(FuzzerInput.decode("utf-8", "replace"))
6-
except tomllib.TOMLDecodeError:
9+
except POSSIBLE_EXCEPTIONS:
710
return
811

0 commit comments

Comments
 (0)