beltoforion / muparserx

A C++ Library for Parsing Expressions with Strings, Complex Numbers, Vectors, Matrices and more.
http://beltoforion.de/en/muparserx
BSD 2-Clause "Simplified" License
135 stars 60 forks source link

More assertions in parser/mpParserBase.cpp, line 1103 #59

Closed nasailja closed 9 years ago

nasailja commented 9 years ago

A couple more assertions remain from the batch I discovered with my first afl run, expressions 80>0?+:0 and 80>0?-:0 lead to Assertion failed: (sidx>=0), function ParseFromRPN, file parser/mpParserBase.cpp, line 1103. This is with muparserx that includes fixes for issues 55-58.

beltoforion commented 9 years ago

They seem pretty straightforward to fix. I'll probably also turn the assertions into an exception but i guess this would prevent you from finding more of the issues. The parser would then just throw an internal error. If you cant find any more I'll do that to be on the safe side.

nasailja commented 9 years ago

I think throwing would be better than asserting in any case as then I could provide a better error message.

beltoforion commented 9 years ago

Fixed in V4.0.2; Main parsing engine does no longer use assertions. You should always get an exception now.