From: mistachkin Date: Thu, 24 Mar 2016 20:36:47 +0000 (+0000) Subject: Prevent negative values of SQLITE_DEFAULT_CACHE_SIZE from making SQLITE_WIN32_HEAP_IN... X-Git-Tag: version-3.12.0~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb2329bed34ec38248e7d78ed34fc79eb9976cc2;p=thirdparty%2Fsqlite.git Prevent negative values of SQLITE_DEFAULT_CACHE_SIZE from making SQLITE_WIN32_HEAP_INIT_SIZE negative. FossilOrigin-Name: e0737f5236ed3e85bd03203c880ee41b34619137 --- diff --git a/manifest b/manifest index 63d4b9b8b2..3716cd5a4b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Larger\smargins\sfor\sone\smemsubsys1\srange\scheck\swhen\srunning\swith\sa\nnon-zero\sreserved-bytes\svalue. -D 2016-03-24T15:32:19.097 +C Prevent\snegative\svalues\sof\sSQLITE_DEFAULT_CACHE_SIZE\sfrom\smaking\sSQLITE_WIN32_HEAP_INIT_SIZE\snegative. +D 2016-03-24T20:36:47.715 F Makefile.in f53429fb2f313c099283659d0df6f20f932c861f F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc df0bf9ff7f8b3f4dd9fb4cc43f92fe58f6ec5c66 @@ -338,7 +338,7 @@ F src/os.h 91ff889115ecd01f436d3611f7f5ea4dc12d92f1 F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c b1ccb273771f41dbdbe0ba7c1ad63c38ad5972ec -F src/os_win.c 17493f12b0b023c2d5a349b6860009f0d45e08d6 +F src/os_win.c 7c071f7f8f04827ab25a8f441080832be58688e9 F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca F src/pager.c 38718a019ca762ba4f6795425d5a54db70d1790d F src/pager.h e1d38a2f14849e219df0f91f8323504d134c8a56 @@ -1459,7 +1459,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P f4d234b5013bf93b6eac7f8be6d4c074cf9f5293 -R 918e030f39e9a5a455482186d2119a1e -U drh -Z 4c4813ba0d5bb38b250579ca5f32f159 +P 6db1d1fbc6c1acc896fa635dfdc5564800502c40 +R 5e26e94cafc58d6fd55eccc4e6c637ee +U mistachkin +Z 1088b9c27d83d36a2ae2a2fd6824e14f diff --git a/manifest.uuid b/manifest.uuid index 75cadabba3..1b00761a79 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6db1d1fbc6c1acc896fa635dfdc5564800502c40 \ No newline at end of file +e0737f5236ed3e85bd03203c880ee41b34619137 \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 3f9fefcac4..7ae833d3f5 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -344,11 +344,23 @@ struct winFile { # define SQLITE_WIN32_HEAP_CREATE (TRUE) #endif +/* + * This is cache size used in the calculation of the initial size of the + * Win32-specific heap. It cannot be negative. + */ +#ifndef SQLITE_WIN32_CACHE_SIZE +# if SQLITE_DEFAULT_CACHE_SIZE>=0 +# define SQLITE_WIN32_CACHE_SIZE (SQLITE_DEFAULT_CACHE_SIZE) +# else +# define SQLITE_WIN32_CACHE_SIZE (-(SQLITE_DEFAULT_CACHE_SIZE)) +# endif +#endif + /* * The initial size of the Win32-specific heap. This value may be zero. */ #ifndef SQLITE_WIN32_HEAP_INIT_SIZE -# define SQLITE_WIN32_HEAP_INIT_SIZE ((SQLITE_DEFAULT_CACHE_SIZE) * \ +# define SQLITE_WIN32_HEAP_INIT_SIZE ((SQLITE_WIN32_CACHE_SIZE) * \ (SQLITE_DEFAULT_PAGE_SIZE) + 4194304) #endif