Calc fix to not allow runaway processing.

This commit is contained in:
Gabriel Weinberg 2013-12-25 19:43:23 -05:00
parent 597e3c0e39
commit cdd0c791c5

View File

@ -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);
};