aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2017-08-07 19:06:54 +0000
committermistachkin <mistachkin@noemail.net>2017-08-07 19:06:54 +0000
commite35395a45a134e9ef99373aa5497a0fed556e4ec (patch)
treec68e23abe9620eaba7f50d1f9346dfbc7a46b4e4 /src/os_unix.c
parent089df506879c9e95476855958a01bb1210f5980c (diff)
downloadsqlite-e35395a45a134e9ef99373aa5497a0fed556e4ec.tar.gz
sqlite-e35395a45a134e9ef99373aa5497a0fed556e4ec.zip
On Windows, avoid casting a value larger than 2^31 to a (SIZE_T) on systems where it is a 32-bit type.
FossilOrigin-Name: f08d63b413601b22726e8b96ff8eb779857321b9df30db0333f71e50ffb5077d
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 3daa8fec9..d1ebd81f6 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3860,7 +3860,8 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
}
/* The value of newLimit may be eventually cast to (size_t) and passed
- ** to mmap(). Restrict its value to 2GB if (size_t) is a 32-bit type. */
+ ** to mmap(). Restrict its value to 2GB if (size_t) is not at least a
+ ** 64-bit type. */
if( newLimit>0 && sizeof(size_t)<8 ){
newLimit = (newLimit & 0x7FFFFFFF);
}