xq icon indicating copy to clipboard operation
xq copied to clipboard

Limit string repeat

Open MiSawa opened this issue 3 years ago • 0 comments

fuzz found

$ cargo fuzz fmt xq artifacts/xq/minimized-from-35b822bd4dbd5db9bca8f9b3c812cec01a6503fd

Output of `std::fmt::Debug`:

(
    "tostring*8E18   ",
    "8 ",
)

Essentially this is "a" * 8E18 that cause an allocation with a huge amount of bytes causing an memory allocation failure. Though we can't fully prevent memory allocation issue anyway...

MiSawa avatar Mar 16 '22 03:03 MiSawa