From c072485125763d11da918aec3232b9e3b113d8dd Mon Sep 17 00:00:00 2001 From: Zim Date: Thu, 3 Jun 2021 16:08:20 +0100 Subject: 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 (cherry picked from commit 4810d35fd17c3ab2f1fcbe9a0c73a8c587623d89) --- dist/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/Android.bp b/dist/Android.bp index 3bb9a10..b63021d 100644 --- a/dist/Android.bp +++ b/dist/Android.bp @@ -39,6 +39,7 @@ cc_defaults { "-DSQLITE_ENABLE_BATCH_ATOMIC_WRITE", "-DBIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD", "-DSQLITE_DEFAULT_LEGACY_ALTER_TABLE", + "-DSQLITE_PRINTF_PRECISION_LIMIT=100000000", "-Wno-unused-parameter", "-Werror", -- cgit v1.2.3