diff options
Diffstat (limited to 'chromium/third_party/sqlite/patches/0013-Fix-UB-warning.patch')
| -rw-r--r-- | chromium/third_party/sqlite/patches/0013-Fix-UB-warning.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/chromium/third_party/sqlite/patches/0013-Fix-UB-warning.patch b/chromium/third_party/sqlite/patches/0013-Fix-UB-warning.patch new file mode 100644 index 00000000000..edd599bce52 --- /dev/null +++ b/chromium/third_party/sqlite/patches/0013-Fix-UB-warning.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Darwin Huang <huangdarwin@chromium.org> +Date: Mon, 16 Dec 2019 13:45:04 -0800 +Subject: [PATCH 13/25] Fix UB warning + +Backports https://sqlite.org/src/info/052fdf5e58b41cca + +Bug: 1032390 +--- + third_party/sqlite/patched/src/util.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/third_party/sqlite/patched/src/util.c b/third_party/sqlite/patched/src/util.c +index 430cdb64742f..0d12b8d53a4c 100644 +--- a/third_party/sqlite/patched/src/util.c ++++ b/third_party/sqlite/patched/src/util.c +@@ -386,7 +386,7 @@ static LONGDOUBLE_TYPE sqlite3Pow10(int E){ + int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){ + #ifndef SQLITE_OMIT_FLOATING_POINT + int incr; +- const char *zEnd = z + length; ++ const char *zEnd; + /* sign * significand * (10 ^ (esign * exponent)) */ + int sign = 1; /* sign of significand */ + i64 s = 0; /* significand */ +@@ -400,9 +400,11 @@ int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){ + + assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); + *pResult = 0.0; /* Default return value, in case of an error */ ++ if( length==0 ) return 0; + + if( enc==SQLITE_UTF8 ){ + incr = 1; ++ zEnd = z + length; + }else{ + int i; + incr = 2; +-- +2.25.0.rc1.283.g88dfdc4193-goog + |
