Skip to content

Commit bfc837d

Browse files
committed
fix broken eval
1 parent 64403a1 commit bfc837d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

smartcalc/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def index_protected():
2323
else:
2424
text = request.form['formula']
2525
try:
26-
result = eval(text)
26+
result = eval(text, {'__builtins__': {}})
2727
except (SyntaxError, NameError):
2828
result = 'Error: wrong input'
2929
return render_template('index.html', result=result, text=text)

0 commit comments

Comments
 (0)