summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZim <zezeozue@google.com>2021-06-03 16:08:20 +0100
committerZimuzo Ezeozue <zezeozue@google.com>2021-06-03 17:57:25 +0000
commitb7e6ee25f15ed49e1f86fa3904f46951b28b67ba (patch)
tree4c051817dc70f61298c92c5de71403922a6292cc
parent349538189943c77b4caa24c1e1be08bca6659c8e (diff)
downloadsqlite-b7e6ee25f15ed49e1f86fa3904f46951b28b67ba.tar.gz
DO NOT MERGE Fix floating point to text conversion overflow
Any precision >=2147483647 will cause a buffer overflow. For instance, executing the following statement will segfault select (printf('%.2147483647G',0.01)); Later sqlite versions fixed this by hard-coding a hard-limit of 100k million on the precision of floating point to text conversions https://sqlite.org/src/info/d08d3405878d394e We fix this on earlier versions by setting the compile time flag to the same 100k million Bug: 153352319 Test: builds Change-Id: Ied86cf81f0064da9d3d963ecf943894bc1ae1a93
-rw-r--r--dist/Android.bp1
1 files changed, 1 insertions, 0 deletions
diff --git a/dist/Android.bp b/dist/Android.bp
index 2211d1f..83e199d 100644
--- a/dist/Android.bp
+++ b/dist/Android.bp
@@ -37,6 +37,7 @@ cc_defaults {
"-DSQLITE_DEFAULT_FILE_PERMISSIONS=0600",
"-DSQLITE_SECURE_DELETE",
"-DSQLITE_ENABLE_BATCH_ATOMIC_WRITE",
+ "-DSQLITE_PRINTF_PRECISION_LIMIT=100000000",
"-Wno-unused-parameter",
"-Werror",
],