Skip to content

Commit a12348b

Browse files
committed
Units(TOML): add a case triggering an infinite loop
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
1 parent 99bcdcc commit a12348b

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Taken from https://github.com/BurntSushi/toml/raw/refs/heads/master/internal/toml-test/tests/invalid/encoding/bad-utf8-at-end.toml
2+
With this input, the TOML parser entered an infinite loop.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
x input.toml /^x = """"""�/;" K
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packcc
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# There is a 0xda at after the quotes, and no EOL at the end of the file.
2+
#
3+
# This is a bit of an edge case: This indicates there should be two bytes
4+
# (0b1101_1010) but there is no byte to follow because it's the end of the file.
5+
x = """"""Ú

0 commit comments

Comments
 (0)