sqlite/6043-Fix-a-potential-32-bit-integer-overflow-in-the-showd.patch

30 lines
953 B
Diff
Raw Normal View History

2019-09-30 11:17:27 -04:00
From 7003b1922263ee4b6131fd458537808ccae22f41 Mon Sep 17 00:00:00 2001
From: "D. Richard Hipp" <drh@hwaci.com>
Date: Tue, 5 Mar 2019 23:49:17 +0000
Subject: [PATCH 1002/1009] Fix a potential 32-bit integer overflow in the
"showdb" utility program when it is trying to interpret a corrupt database
file.
https://github.com/mackyle/sqlite/commit/7003b1922263ee4b6131fd458537808ccae22f41
---
tool/showdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tool/showdb.c b/tool/showdb.c
index ba7a362..cb6ddab 100644
--- a/tool/showdb.c
+++ b/tool/showdb.c
@@ -828,7 +828,7 @@ static void page_usage_cell(
while( ovfl && (cnt++)<g.mxPage ){
page_usage_msg(ovfl, "overflow %d from cell %d of page %d",
cnt, cellno, pgno);
- a = fileRead((ovfl-1)*g.pagesize, 4);
+ a = fileRead((ovfl-1)*(sqlite3_int64)g.pagesize, 4);
ovfl = decodeInt32(a);
sqlite3_free(a);
}
--
1.8.3.1