SQLite Forum

several potential NULL pointer dereferences
Login
> There are potential NULL pointer dereferences

No, there is not.  Though, the situation is complex and the proof that
sqlite3ExprSkipCollateAndLikely() can never return NULL in the contexts
you site is difficult and probably beyond the
capability of your static analyzer.  For that reason, I did put in checks
to verify that the result is not NULL.  See
[check-in 76d2eb86e109fc3c](src:/info/76d2eb86e109fc3c).

Notice, however, that all of these checks must be put inside of NEVER()
or ALWAYS() (depending on the sense of the check) since the conditional
is always false or true, respectively.  Without the use of the NEVER()
and ALWAYS() macros, we would be left with unreachable branches and our
branch coverage testing would fail.

To summarize, then:  This is a false-positive in your static analyzer,
not an actual bug.  Nevertheless, it does provide an opportunity to make
the code simpler to understand and prove correct, and so appropriate
adjustments where made to that end.