Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't crash on invalid variable names in RPN
When rpn_parse() finds [^\0,] after parsing a token, it returns NULL without setting an error. This causes rrd_test_error() to return false and subsequent code will dereference NULL (cf. rrdtool xport CDEF:foo=foo-bar). This commit changes the OP_VARIABLE branch in rpn_parse so that in order to be a variable name, sscanf needs to match the full name, causing a more meaningful "ERROR: don't understand 'illegal-variable-name'" error message in that case. Also, I made the return NULL branch set an error message so rrd_test_error() will succeed.
- Loading branch information