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:01 +0000
commitcc22cf390226e23caa4b450cb003fece84943e2c (patch)
treebb8163fee24248f5da7c6ef52f59e87781ad2b8d
parent673358d13e18bec5a03fd13ff0e29725228f64e0 (diff)
downloadsqlite-cc22cf390226e23caa4b450cb003fece84943e2c.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 95cd1ae..17373b3 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",
],