-
Notifications
You must be signed in to change notification settings - Fork 1.4k
sqlcipher_export_init declared with the wrong type #590
Copy link
Copy link
Open
Description
sqlcipher_export_init is registered as an sqlite "auto extension" function, of which the intended type is the following:
typedef int (*sqlite3_loadext_entry)(
sqlite3 *db, /* Handle to the database. */
char **pzErrMsg, /* Used to set error string on failure. */
const sqlite3_api_routines *pThunk /* Extension API function pointers. */
);
However,sqlcipher_export_init is declared as:
static int sqlcipher_export_init(sqlite3* db, const char** errmsg, const struct sqlite3_api_routines* api)
Note the second parameter is const char* instead of char*. We came across this problem because UBSAN ("undefined behavior sanitizer") flags this as a mismatched function call at runtime. I don't think it has any practical downside, since errmsg is unused in sqlcipher_export_init, but it is worth fixing so the sanitizer doesn't complain.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels