mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Make sure filenames handed to the VFS by the fake_big_file test procedure
are double-zero terminated. FossilOrigin-Name: d0a868607e8f46941ece9f9d7b8ba220a7fb4e2b
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Only\srequire\sdouble-zero\sterminators\son\sdatabase\sfilenames,\snot\sany\severy\nfiles\ssupplied\sto\sthe\sxOpen\smethod.\s\sThis\sbacks\sout\s[2544f233f1].\s\sAlso\nrefactor\sthe\sfillInUnixFile()\sroutine\sin\sos_unix.c\sto\sreduce\sthe\snumber\nof\sparameters.
|
C Make\ssure\sfilenames\shanded\sto\sthe\sVFS\sby\sthe\sfake_big_file\stest\sprocedure\nare\sdouble-zero\sterminated.
|
||||||
D 2012-01-10T23:18:38.025
|
D 2012-01-11T00:38:51.026
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07
|
F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -190,7 +190,7 @@ F src/status.c 4568e72dfd36b6a5911f93457364deb072e0b03a
|
|||||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||||
F src/tclsqlite.c bd86070f52ae3f77a2e6b3b065ff03adb9140bfa
|
F src/tclsqlite.c bd86070f52ae3f77a2e6b3b065ff03adb9140bfa
|
||||||
F src/test1.c 1b1e514e85ffe7152b02cba38bd0a1ce8cd56113
|
F src/test1.c 1b1e514e85ffe7152b02cba38bd0a1ce8cd56113
|
||||||
F src/test2.c 80d323d11e909cf0eb1b6fbb4ac22276483bcf31
|
F src/test2.c 711555927f1f7e8db9aab86b512bc6934a774abe
|
||||||
F src/test3.c 91d3f1a09cfae3533ef17d8b484a160f3d1f1a21
|
F src/test3.c 91d3f1a09cfae3533ef17d8b484a160f3d1f1a21
|
||||||
F src/test4.c d1e5a5e904d4b444cf572391fdcb017638e36ff7
|
F src/test4.c d1e5a5e904d4b444cf572391fdcb017638e36ff7
|
||||||
F src/test5.c e1a19845625144caf038031234a12185e40d315c
|
F src/test5.c e1a19845625144caf038031234a12185e40d315c
|
||||||
@@ -986,7 +986,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
|
|||||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||||
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
|
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
|
||||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||||
P 722735a4f316630c907149f08d3d7dccc0facd9a af59b182d797642e5ec3ddf291cf62662a136bd1
|
P cb774b26e13745cfad0d76a71e47466d703e0007
|
||||||
R 0517e1b31ad3aca42e254a546daa87b4
|
R 780bf2e97bf51fe59b326674e184191e
|
||||||
U drh
|
U drh
|
||||||
Z c7868cbe469d9c92bafb5dccf1093985
|
Z 3db9953fe728ac89f28aade46f63b156
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
cb774b26e13745cfad0d76a71e47466d703e0007
|
d0a868607e8f46941ece9f9d7b8ba220a7fb4e2b
|
||||||
11
src/test2.c
11
src/test2.c
@@ -537,6 +537,8 @@ static int fake_big_file(
|
|||||||
int rc;
|
int rc;
|
||||||
int n;
|
int n;
|
||||||
i64 offset;
|
i64 offset;
|
||||||
|
char *zFile;
|
||||||
|
int nFile;
|
||||||
if( argc!=3 ){
|
if( argc!=3 ){
|
||||||
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
|
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
|
||||||
" N-MEGABYTES FILE\"", 0);
|
" N-MEGABYTES FILE\"", 0);
|
||||||
@@ -545,17 +547,24 @@ static int fake_big_file(
|
|||||||
if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR;
|
if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR;
|
||||||
|
|
||||||
pVfs = sqlite3_vfs_find(0);
|
pVfs = sqlite3_vfs_find(0);
|
||||||
rc = sqlite3OsOpenMalloc(pVfs, argv[2], &fd,
|
nFile = strlen(argv[2]);
|
||||||
|
zFile = sqlite3_malloc( nFile+2 );
|
||||||
|
if( zFile==0 ) return TCL_ERROR;
|
||||||
|
memcpy(zFile, argv[2], nFile+1);
|
||||||
|
zFile[nFile+1] = 0;
|
||||||
|
rc = sqlite3OsOpenMalloc(pVfs, zFile, &fd,
|
||||||
(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB), 0
|
(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB), 0
|
||||||
);
|
);
|
||||||
if( rc ){
|
if( rc ){
|
||||||
Tcl_AppendResult(interp, "open failed: ", errorName(rc), 0);
|
Tcl_AppendResult(interp, "open failed: ", errorName(rc), 0);
|
||||||
|
sqlite3_free(zFile);
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
offset = n;
|
offset = n;
|
||||||
offset *= 1024*1024;
|
offset *= 1024*1024;
|
||||||
rc = sqlite3OsWrite(fd, "Hello, World!", 14, offset);
|
rc = sqlite3OsWrite(fd, "Hello, World!", 14, offset);
|
||||||
sqlite3OsCloseFree(fd);
|
sqlite3OsCloseFree(fd);
|
||||||
|
sqlite3_free(zFile);
|
||||||
if( rc ){
|
if( rc ){
|
||||||
Tcl_AppendResult(interp, "write failed: ", errorName(rc), 0);
|
Tcl_AppendResult(interp, "write failed: ", errorName(rc), 0);
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user