Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on New differential fuzzing tool reveals novel HTTP request smuggling techniques. Parent comment
JSON is a terrible format. Especially for streaming data.
Here's a super simple shell script for generating invalid JSON that will blow Python's stack:
n="$(python3 -c 'import math; import sys; sys.stdout.write(str(math.floor(sys.getrecursionlimit() - 4)))')" left="$(yes [ | head -n "$n" | tr -d '\n')" echo "$left" | python3 -c 'import json; print(json.loads(input()))'
a) You run out of memory.
b) The connection ends.
Because JSON is terrible for streaming data.
There are no comments on this comment yet.
JSON is a terrible format. Especially for streaming data.
Here's a super simple shell script for generating invalid JSON that will blow Python's stack:
It is invalid JSON. But you cannot tell if it's invalid until either:a) You run out of memory.
b) The connection ends.
Because JSON is terrible for streaming data.