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

Fix a problem with handling SQLITE_FCNTL_MMAP_SIZE requests with a negative

parameter in os_unix.c.

FossilOrigin-Name: 4249fcf7b0c0233f9b3ba5139702738d5221c5309240e6e91dc139eff59471fe
This commit is contained in:
dan
2017-08-07 18:54:10 +00:00
parent 010a016ac9
commit 089df50687
3 changed files with 8 additions and 8 deletions

View File

@@ -3861,7 +3861,7 @@ 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. */
if( sizeof(size_t)<8 ){
if( newLimit>0 && sizeof(size_t)<8 ){
newLimit = (newLimit & 0x7FFFFFFF);
}