Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit 880009b

Browse files
committed
sqlite: Upgrade to SQLite 3.28.0
Downloaded from https://sqlite.org/2019/sqlite-autoconf-3280000.tar.gz $ sha1sum sqlite-autoconf-3280000.tar.gz 01b9d8fc77085e144dddc87456c9783e53d09a53 sqlite-autoconf-3280000.tar.gz dist/orig contains the stock sqlite3 code, as packaged in the tar.gz file above. dist contains a copy of dist/orig, but with the Android.patch file applied. The Android specific patch didn't apply cleanly due to merge conflict in shell.c. The conflict was resolved and the patch was regenerated. More details about the release are available here: https://www.sqlite.org/releaselog/3_28_0.html Test: code compiles and device boots with no problems. Test: select sqlite_version() - returns 3.28.0 Test: atest cts/SQLiteDatabaseTest all passed. Test: atest cts/SQLiteSecurityTest Bug: 135048770 Change-Id: Idf38a3adace9f4bd4feab4012c9cc4de3a1c501c
1 parent 6d1591e commit 880009b

File tree

10 files changed

+88078
-52011
lines changed

10 files changed

+88078
-52011
lines changed

README.version

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
URL: https://www.sqlite.org/src/info/c255889bd95bd543
2-
Version: 3.22.0 c255889bd95bd5430dc7ced3317011ae2abb483d6c9af883af3dc7d6c2c2f234
3-
This patch fixes Magellan SQLite Security Vulnerability as in b/121156452
1+
URL: https://sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
2+
Version: 3.28.0 884b4b7e
43
BugComponent: 24950

dist/Android.patch

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- orig/shell.c 2018-04-17 11:53:05.520972146 +0100
2-
+++ shell.c 2019-03-14 19:26:19.523122555 +0000
1+
--- orig/shell.c 2019-06-11 15:05:36.341739007 -0700
2+
+++ shell.c 2019-06-11 15:05:36.401739332 -0700
33
@@ -87,6 +87,12 @@
44
#endif
55
#include <ctype.h>
@@ -13,33 +13,33 @@
1313

1414
#if !defined(_WIN32) && !defined(WIN32)
1515
# include <signal.h>
16-
@@ -10389,6 +10395,23 @@
17-
editFunc, 0, 0);
16+
@@ -11698,6 +11704,23 @@
1817
sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0,
1918
editFunc, 0, 0);
19+
#endif
2020
+
21-
+ // Begin Android Add
22-
+ #ifndef NO_ANDROID_FUNCS
23-
+ AIcu_initializeIcuOrDie();
24-
+ int err = register_localized_collators(p->db, "en_US", 0);
25-
+ if (err != SQLITE_OK) {
26-
+ fprintf(stderr, "register_localized_collators() failed\n");
27-
+ exit(1);
28-
+ }
29-
+ err = register_android_functions(p->db, 0);
30-
+ if (err != SQLITE_OK) {
31-
+ fprintf(stderr, "register_android_functions() failed\n");
32-
+ exit(1);
33-
+ }
34-
+ #endif
35-
+ // End Android Add
21+
+// Begin Android Add
22+
+#ifndef NO_ANDROID_FUNCS
23+
+ AIcu_initializeIcuOrDie();
24+
+ int err = register_localized_collators(p->db, "en_US", 0);
25+
+ if (err != SQLITE_OK) {
26+
+ fprintf(stderr, "register_localized_collators() failed\n");
27+
+ exit(1);
28+
+ }
29+
+ err = register_android_functions(p->db, 0);
30+
+ if (err != SQLITE_OK) {
31+
+ fprintf(stderr, "register_android_functions() failed\n");
32+
+ exit(1);
33+
+ }
34+
+#endif
35+
+// End Android Add
3636
+
3737
if( p->openMode==SHELL_OPEN_ZIPFILE ){
3838
char *zSql = sqlite3_mprintf(
3939
"CREATE VIRTUAL TABLE zip USING zipfile(%Q);", p->zDbFilename);
40-
--- orig/sqlite3.c 2019-03-11 19:52:44.237549639 +0000
41-
+++ sqlite3.c 2019-03-11 19:52:44.293549396 +0000
42-
@@ -30672,6 +30672,10 @@
40+
--- orig/sqlite3.c 2019-06-11 15:05:36.393739289 -0700
41+
+++ sqlite3.c 2019-06-11 15:05:36.449739593 -0700
42+
@@ -32438,6 +32438,10 @@
4343
# include <sys/mount.h>
4444
#endif
4545

@@ -50,7 +50,7 @@
5050
#ifdef HAVE_UTIME
5151
# include <utime.h>
5252
#endif
53-
@@ -31422,6 +31426,12 @@
53+
@@ -33197,6 +33201,12 @@
5454
#if defined(FD_CLOEXEC) && (!defined(O_CLOEXEC) || O_CLOEXEC==0)
5555
osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
5656
#endif
@@ -63,7 +63,7 @@
6363
}
6464
return fd;
6565
}
66-
@@ -31954,7 +31964,13 @@
66+
@@ -33777,7 +33787,13 @@
6767
** and move on.
6868
*/
6969
static void robust_close(unixFile *pFile, int h, int lineno){
@@ -77,7 +77,7 @@
7777
unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close",
7878
pFile ? pFile->zPath : 0, lineno);
7979
}
80-
@@ -34428,7 +34444,7 @@
80+
@@ -36310,7 +36326,7 @@
8181
SimulateIOError( rc=1 );
8282
if( rc!=0 ){
8383
storeLastErrno((unixFile*)id, errno);
@@ -86,7 +86,7 @@
8686
}
8787
*pSize = buf.st_size;
8888

89-
@@ -34464,7 +34480,7 @@
89+
@@ -36346,7 +36362,7 @@
9090
struct stat buf; /* Used to hold return values of fstat() */
9191

9292
if( osFstat(pFile->h, &buf) ){
@@ -95,7 +95,7 @@
9595
}
9696

9797
nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
98-
@@ -35139,7 +35155,7 @@
98+
@@ -37032,7 +37048,7 @@
9999
** with the same permissions.
100100
*/
101101
if( osFstat(pDbFd->h, &sStat) ){
@@ -104,7 +104,7 @@
104104
goto shm_open_err;
105105
}
106106

107-
@@ -118054,7 +118070,7 @@
107+
@@ -123984,7 +124000,7 @@
108108
}
109109
if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
110110
sqlite3SetString(pzErrMsg, db, "unsupported file format");
@@ -113,7 +113,7 @@
113113
goto initone_error_out;
114114
}
115115

116-
@@ -152769,13 +152785,25 @@
116+
@@ -164271,13 +164287,25 @@
117117
** module with sqlite.
118118
*/
119119
if( SQLITE_OK==rc

0 commit comments

Comments
 (0)