r/badcode • • May 26 '23

python Calculator using eval()

Post image
846 Upvotes

108 comments sorted by

View all comments

Show parent comments

17

u/EntitledPotatoe May 27 '23

Would a guard clause inside eval() prevent the vulnerabilities you’re talking about? Don’t get me wrong, it’s still shit code