MiSawa / xq

Pure rust implementation of jq
MIT License
318 stars 18 forks source link

Limit string repeat #129

Open MiSawa opened 2 years ago

MiSawa commented 2 years ago

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...