mirror of
https://github.com/fluencelabs/sqlite
synced 2025-04-24 17:02:14 +00:00
final preparation
This commit is contained in:
parent
2150b81cf6
commit
932bfb38a1
@ -1,4 +1,4 @@
|
|||||||
(@interface it_version "0.19.0"
|
(@interface it_version "0.19.0")
|
||||||
|
|
||||||
;; Types
|
;; Types
|
||||||
(@interface type (func
|
(@interface type (func
|
||||||
|
@ -35,7 +35,7 @@ void sqlite3_exec_(
|
|||||||
sqlite3_callback xCallback, /* Invoke this callback routine */
|
sqlite3_callback xCallback, /* Invoke this callback routine */
|
||||||
void *pArg /* First argument to xCallback() */
|
void *pArg /* First argument to xCallback() */
|
||||||
) __EXPORT_NAME(sqlite3_exec) {
|
) __EXPORT_NAME(sqlite3_exec) {
|
||||||
zSql[zSql_len] = '\x00';
|
zSql = handle_input_string(zSql, zSql_len);
|
||||||
|
|
||||||
char *pzErrMsg = 0;
|
char *pzErrMsg = 0;
|
||||||
const int ret_code = sqlite3_exec(db, zSql, xCallback, pArg, &pzErrMsg);
|
const int ret_code = sqlite3_exec(db, zSql, xCallback, pArg, &pzErrMsg);
|
||||||
|
@ -3443,9 +3443,8 @@ void sqlite3_open_v2_(
|
|||||||
char *zVfs, /* Name of VFS module to use */
|
char *zVfs, /* Name of VFS module to use */
|
||||||
int zVfs_len
|
int zVfs_len
|
||||||
) __EXPORT_NAME(sqlite3_open_v2) {
|
) __EXPORT_NAME(sqlite3_open_v2) {
|
||||||
// this strings were allocated by the allocate function that allocates 1 byte more for null character
|
filename = handle_input_string(filename, filename_len);
|
||||||
filename[filename_len] = '\x00';
|
zVfs = handle_input_string(zVfs, zVfs_len);
|
||||||
zVfs[zVfs_len] = '\x00';
|
|
||||||
|
|
||||||
sqlite3 *ppDb;
|
sqlite3 *ppDb;
|
||||||
|
|
||||||
|
@ -4913,6 +4913,8 @@ void add_object_to_release(void *object);
|
|||||||
|
|
||||||
void set_result_ptr(void *ptr);
|
void set_result_ptr(void *ptr);
|
||||||
void set_result_size(int size);
|
void set_result_size(int size);
|
||||||
|
|
||||||
|
char *handle_input_string(char *str, int len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SQLITEINT_H */
|
#endif /* SQLITEINT_H */
|
||||||
|
@ -43,6 +43,17 @@ void *get_result_ptr() {
|
|||||||
return RESULT_PTR;
|
return RESULT_PTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *handle_input_string(char *str, int len) {
|
||||||
|
if (len == 0) {
|
||||||
|
free(str);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this strings are supposed to be allocated by the allocate function, which allocates 1 byte more for null character
|
||||||
|
str[len] = '\x00';
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
// the main purpose of this empty main is to initialize WASI subsystem
|
// the main purpose of this empty main is to initialize WASI subsystem
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user