aboutsummaryrefslogtreecommitdiffstats
path: root/main/sqlite/CVE-2017-10989.patch
blob: b58fd64a19eb315216e5c672aaaf868571b3ef74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/sqlite3.c b/sqlite3.c
index aaab200..dcaf732 100644
--- a/sqlite3.c
+++ b/sqlite3.c
@@ -164546,6 +164546,10 @@ static int getNodeSize(
     rc = getIntFromStmt(db, zSql, &pRtree->iNodeSize);
     if( rc!=SQLITE_OK ){
       *pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db));
+    }else if( pRtree->iNodeSize<(512-64) ){
+      rc = SQLITE_CORRUPT;
+      *pzErr = sqlite3_mprintf("undersize RTree blobs in \"%q_node\"",
+                               pRtree->zName);
     }
   }