Merge pull request #279 from duckduckgo/yegg/calc-fix
Calc fix to not allow runaway processing.master
commit
7711c13083
|
@ -94,6 +94,8 @@ handle query_nowhitespace => sub {
|
|||
$tmp_expr =~ s/(?<!\.)(?<![0-9])0([1-9])/$1/;
|
||||
|
||||
eval {
|
||||
# e.g. sin(100000)/100000 completely makes this go haywire.
|
||||
alarm(1);
|
||||
$tmp_result = eval($tmp_expr);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue