]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add assert()s to the implementation of xRead() in the built-in VFSes to
authordrh <drh@noemail.net>
Thu, 9 May 2013 18:12:40 +0000 (18:12 +0000)
committerdrh <drh@noemail.net>
Thu, 9 May 2013 18:12:40 +0000 (18:12 +0000)
verify that the offset parameter is always non-negative.

FossilOrigin-Name: cf5c3642247fdd34d87f0368594cd7b8f081636a

manifest
manifest.uuid
src/os_unix.c
src/os_win.c

index 3e1372250e3133b5a94e38829af4935ca5a504c6..525586f02f2fb9de6ee5a634d2e06f7587c123a9 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Do\snot\smove\sWHERE\sclause\sterms\sinside\sOR\sexpressions\sthat\sare\scontained\nwithin\san\sON\sclause\sof\sa\sLEFT\sJOIN.\s\sFix\sfor\sticket\s[f2369304e47167e3e].
-D 2013-05-09T14:20:11.944
+C Add\sassert()s\sto\sthe\simplementation\sof\sxRead()\sin\sthe\sbuilt-in\sVFSes\sto\s\nverify\sthat\sthe\soffset\sparameter\sis\salways\snon-negative.
+D 2013-05-09T18:12:40.898
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in ce81671efd6223d19d4c8c6b88ac2c4134427111
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -176,8 +176,8 @@ F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30
 F src/os.c b4ad71336fd96f97776f75587cd9e8218288f5be
 F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
-F src/os_unix.c 658b180a09a18214d94547f737dbded71667cdab
-F src/os_win.c bf297963be89f9cddab53c3356e79daa3b8240d2
+F src/os_unix.c 5e0b0ca7594f6707a3ed155528a3ba3318c95e15
+F src/os_win.c 4e2bf0760409aef35e298ff725054e94d834e1a3
 F src/pager.c 49e23f9898113ddfe90942bdf1c1ef57955d0921
 F src/pager.h 5cb78b8e1adfd5451e600be7719f5a99d87ac3b1
 F src/parse.y 9708365594eea519cdc8504dee425c0a41c79502
@@ -1062,7 +1062,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 610425f19008b8b5d4bf027c8b14d97ec3115a54
-R 4023dbf2ca58f8c405419172cf8781f4
+P 1128575d0ab24f7023a0f6e6ce4828b9a09a7c6c
+R 1cad29e868ca8cf8d5b7d354acd90934
 U drh
-Z cd99743e7f7615602ad15535e32e4fa6
+Z 3b3f34da85296e9879a826be138cb510
index df6e547ae9ce038a697a63b32346990529f38e93..03a8fec162bfe28946a339957f24df516cc23161 100644 (file)
@@ -1 +1 @@
-1128575d0ab24f7023a0f6e6ce4828b9a09a7c6c
\ No newline at end of file
+cf5c3642247fdd34d87f0368594cd7b8f081636a
\ No newline at end of file
index 6eed6740726c8b623f8708d14b60921f06653c3d..30d79f0c5091be5c2c9a95476389f22943435b1f 100644 (file)
@@ -3152,6 +3152,8 @@ static int unixRead(
   unixFile *pFile = (unixFile *)id;
   int got;
   assert( id );
+  assert( offset>=0 );
+  assert( amt>0 );
 
   /* If this is a database file (not a journal, master-journal or temp
   ** file), the bytes in the locking range should never be read or written. */
index e308248158a2ec0a6afd9af3aebed10e7bfd0358..66f0703878b87b797df2996aab08669e0f745e17 100644 (file)
@@ -2157,6 +2157,7 @@ static int winRead(
 
   assert( id!=0 );
   assert( amt>0 );
+  assert( offset>=0 );
   SimulateIOError(return SQLITE_IOERR_READ);
   OSTRACE(("READ file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
            pFile->h, pBuf, amt, offset, pFile->locktype));