Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
String empty check in PLtsql_expr_query_mutator (babelfish-for-postgr…
…esql#2432) Add a check that string is not empty before calling `.front()` on it (that is apparently [an UB on empty string](https://en.cppreference.com/w/cpp/string/basic_string/front)). There are many usages of `.front()` like this in `tsqlIface.cpp`, but AFAICS they always operate on known non-empty strings. Not sure if more non-empty checks before `.front()` calls are necessary there. Such crashes are deterministic with `-O0`, I've run JDBC test suite with `-O0` server and didn't get any more crashes. ### Issues Resolved babelfish-for-postgresql#2431 ### Test Scenarios Covered ### Without patch the problem is reproducible with [AVG-Aggregate-common-vu-verify](https://github.com/babelfish-for-postgresql/babelfish_extensions/blob/b38e6e2c0261725627d9ac751721e50501af6eef/test/JDBC/input/AVG-Aggregate-common-vu-verify.sql#L65) existing test (and probably some others). Signed-off-by: Alex Kasko <[email protected]>
- Loading branch information