File tree Expand file tree Collapse file tree
sqlite-wasm-rs/src/shim/vfs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,9 @@ unsafe extern "C" fn xDelete(
130130 zName : * const :: std:: os:: raw:: c_char ,
131131 _syncDir : :: std:: os:: raw:: c_int ,
132132) -> :: std:: os:: raw:: c_int {
133+ if zName. is_null ( ) {
134+ return SQLITE_IOERR_DELETE ;
135+ }
133136 let Ok ( s) = CStr :: from_ptr ( zName) . to_str ( ) else {
134137 return SQLITE_ERROR ;
135138 } ;
@@ -143,10 +146,14 @@ unsafe extern "C" fn xAccess(
143146 _flags : :: std:: os:: raw:: c_int ,
144147 pResOut : * mut :: std:: os:: raw:: c_int ,
145148) -> :: std:: os:: raw:: c_int {
146- let Ok ( s) = CStr :: from_ptr ( zName) . to_str ( ) else {
147- return SQLITE_ERROR ;
149+ * pResOut = if zName. is_null ( ) {
150+ 0
151+ } else {
152+ let Ok ( s) = CStr :: from_ptr ( zName) . to_str ( ) else {
153+ return SQLITE_ERROR ;
154+ } ;
155+ i32:: from ( name2file ( ) . contains_key ( s) )
148156 } ;
149- * pResOut = i32:: from ( name2file ( ) . contains_key ( s) ) ;
150157 SQLITE_OK
151158}
152159
You can’t perform that action at this time.
0 commit comments