Closed mschessler closed 3 months ago
This is expected behavior. I did it to not to decrease performance because of function checking. Alternatively I created another service to validate formula input.
Example 1:
Example 2:
Hey, thanks for the fast answer. I was not aware of the check syntax function. The problem unfortunately still remains. New inputs that pass the check function but still crash:
";;" -> System.InvalidOperationException
"-(!())" -> System.ArgumentOutOfRangeException
Thank you!
I will fix it in the next version.
Not sure how interested you are, I'm just having some fun playing around with C# Fuzzing.
So here is another one:
"LeN(2)" -> System.NullReferenceException
If you want to I will report all findings in a few days, but I understand if you say that these bugs are not that relevant.
If you share the results, I will be grateful)
On the other hand, I'm not sure should I validate functions or not. For example, "UPPER()" will throw as well, I left it to show an error immediately. I mean if exception throws user can review formula immediately, but if I will return some value, even my wrapper around null, user can realize that later
Evaluator.Parse() throws unexpected exceptions on malformed input.
Example 1:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') at System.Collections.Generic.List
1.get_Item(Int32 index) at NoStringEvaluating.Functions.Logic.NotAliasFunction.Execute(List
1 args, ValueFactory factory) at NoStringEvaluating.NoStringEvaluator.CalcFunction(FunctionWrapperNode functionWrapper, VariablesSource variables, ValueKeeperContainer valueKeeperContainer) at NoStringEvaluating.NoStringEvaluator.CalcInternal(List1 nodes, VariablesSource variables, ValueKeeperContainer valueKeeperContainer) at NoStringEvaluating.NoStringEvaluator.OnCalcAggregated(List
1 nodes, VariablesSource variables) at NoStringEvaluating.NoStringEvaluator.Calc(String formula)Example 2:
evaluator.Calc("(");
System.InvalidOperationException: Stack empty. at System.Collections.Generic.Stack
1.ThrowForEmptyStack() at System.Collections.Generic.Stack
1.Pop() at NoStringEvaluating.NoStringEvaluator.CalcInternal(List1 nodes, VariablesSource variables, ValueKeeperContainer valueKeeperContainer) at NoStringEvaluating.NoStringEvaluator.OnCalcAggregated(List
1 nodes, VariablesSource variables) at NoStringEvaluating.NoStringEvaluator.Calc(String formula)