From: drh Date: Thu, 5 Dec 2013 16:41:55 +0000 (+0000) Subject: Fix two potential (and apparently harmless) shift overflows discovered by X-Git-Tag: version-3.8.2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47676fedf640e2433bde647a6c3343fa2e3a64c0;p=thirdparty%2Fsqlite.git Fix two potential (and apparently harmless) shift overflows discovered by the -fcatch-undefined-behavior option of clang. FossilOrigin-Name: e19eead8c9977ed4f00eac54c5bc7e90db78caa8 --- diff --git a/manifest b/manifest index aceb0f89c8..3b88511979 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sa\sbranch\sin\sSTAT4\slogic\sthat\sis\sno\slonger\sreachable\safter\s\nthe\sprevious\schange. -D 2013-12-03T19:49:55.482 +C Fix\stwo\spotential\s(and\sapparently\sharmless)\sshift\soverflows\sdiscovered\sby\nthe\s-fcatch-undefined-behavior\soption\sof\sclang. +D 2013-12-05T16:41:55.583 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -205,7 +205,7 @@ 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 143624d9eabb3b997c59cf594e0d06c56edd43e9 +F src/os_unix.c f076587029285554a3a65d30d0e71d50cd61f41f F src/os_win.c 4323dd0bac4f7a7037fc4cf87fb4692d17f0b108 F src/pager.c 2aa4444ffe86e9282d03bc349a4a5e49bd77c0e8 F src/pager.h f094af9f6ececfaa8a1e93876905a4f34233fb0c @@ -278,7 +278,7 @@ F src/tokenize.c ec4c1a62b890bf1dbcdb966399e140b904c700a4 F src/trigger.c d84e1f3669e9a217731a14a9d472b1c7b87c87ba F src/update.c d1c2477dcf14d90999d1935af4efb4806553250b F src/utf.c 6fc6c88d50448c469c5c196acf21617a24f90269 -F src/util.c c1d47254d805074226eb68bab2327f2559799d88 +F src/util.c 76ed0519296e3f62e97e57dab1999e34184c8e49 F src/vacuum.c 3728d74919d4fb1356f9e9a13e27773db60b7179 F src/vdbe.c 54894fde8dc806d259e015ac7c9680145e725835 F src/vdbe.h c06f0813f853566457ce9cfb1a4a4bc39a5da644 @@ -1145,7 +1145,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 33ad4f91477907b7b3e5808c7ba11aacc9a83ba6 -R b9a8385eb7153992ed9d3229f4d58e8a +P eca7d3f1612c7a009a9e4ef89f76f9b7e275d1e6 +R ba7aebdef816e4dde9f2f30108dfb7a9 U drh -Z 1abf6c68d7a5a613f293f6a4e7a65cb6 +Z d225deef3eea562cd29618981c6f7c47 diff --git a/manifest.uuid b/manifest.uuid index 33fe443f15..7d458eb325 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -eca7d3f1612c7a009a9e4ef89f76f9b7e275d1e6 \ No newline at end of file +e19eead8c9977ed4f00eac54c5bc7e90db78caa8 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 501b1b769d..ab657dc7bd 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4081,7 +4081,7 @@ static int unixShmSystemLock( #ifdef SQLITE_DEBUG { u16 mask; OSTRACE(("SHM-LOCK ")); - mask = (1<<(ofst+n)) - (1<31 ? 0xffffffff : (1<<(ofst+n)) - (1<=5 ) n -= 2; else if( n>=1 ) n -= 1; - if( x>=3 ) return (n+8)<<(x-3); + if( x>=3 ){ + return x>60 ? (u64)LARGEST_INT64 : (n+8)<<(x-3); + } return (n+8)>>(3-x); }