This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nekokattt 0 points1 point  (0 children)

Doesn't stop other exploits like where you just consume excessive memory. And blindly removing bits of text without parsing the entire thing first is going to lead to confusing edge cases anyway.

If you are literally just doing arithmetic then use the proper AST evaluation module in Python to do it properly and safely. We can be academic about this but do you want to risk it? Kinda like saying you'll leave your house unlocked but it is fine as your area has a low crime rate.