2 ms·
Looks to me like the actual problem is in string.__mul__ -- that one's got arbitrary memory usage. Better limit those arguments...
by klyrs 4y ago
Looks to me like the actual problem is in string.__mul__ -- that one's got arbitrary memory usage. Better limit those arguments...
- masklinn 4y agostr.__mul__ is just a conveniently short way to demonstrate the issue, the target is pretty much any parsing routine exposed to outside users e.g. any JSON API.
- klyrs 4y agoApologies, my comment is snark. The algorithm in question is soft-linear, faster implementations exist, this seems like an incredibly myopic fix. Just make a bigger JSON blob and it will take longer to parse.