symisc / unqlite

An Embedded NoSQL, Transactional Database Engine
https://unqlite.symisc.net
Other
2.09k stars 163 forks source link

unqlite.c: inconsistent null check #156

Closed b4yuan closed 1 year ago

b4yuan commented 1 year ago

Every time the following line is set in unqlite.c:

pVm = (unqlite_vm *)jx9_context_user_data(pCtx);

pVm is never checked for null. There are instances in other files where the return value of jx9_context_user_data is checked, which may suggest a need for a null check.

symisc commented 1 year ago

Upper layers already make sure that the Jx9 VM is already allocated and ready to be used by client code.