tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
9.54k stars 252 forks source link

provide one more required argument for SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION config command #1477

Closed sivukhin closed 3 months ago

sivukhin commented 3 months ago

Context

SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION config verb require 2 additional arguments: on/off flag and pointer to the location where new state of the config will be written.

libsql misses last parameter which generally leads to UB and more specifically SEGFAULT under release builds (see https://github.com/tursodatabase/libsql/issues/1473)

This PR set second additional argument to null in order to comply with SQLite API specification.

See https://sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigenableloadextension for the config verb description

Testing