1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

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
This commit is contained in:
mistachkin
2017-08-07 19:06:54 +00:00
parent 089df50687
commit e35395a45a
4 changed files with 19 additions and 10 deletions

View File

@@ -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);
}