1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix incorrect validation of the size of the BLOB returned by a geometry

function on the RHS of a MATCH operator in RTree.  The old code worked for
64-bit systems (by chance) but fails on 32-bit.

FossilOrigin-Name: 10cc44f5a63e6cadf6940bb7310a177ee7fa6ee2
This commit is contained in:
drh
2015-05-22 23:17:28 +00:00
parent 381ef8124c
commit 18070e08c5
3 changed files with 8 additions and 11 deletions

View File

@ -1483,9 +1483,7 @@ static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
/* Check that the blob is roughly the right size. */
nBlob = sqlite3_value_bytes(pValue);
if( nBlob<(int)sizeof(RtreeMatchArg)
|| ((nBlob-sizeof(RtreeMatchArg))%sizeof(RtreeDValue))!=0
){
if( nBlob<(int)sizeof(RtreeMatchArg) ){
return SQLITE_ERROR;
}