Skip to content

Commit 608d28e

Browse files
committed
Merge sqlite-release(3.45.3) into prerelease-integration
2 parents e94562c + 7b69f52 commit 608d28e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+514
-148
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.45.2
1+
3.45.3

autoconf/tea/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
1919
# so that we create the export library with the dll.
2020
#-----------------------------------------------------------------------
2121

22-
AC_INIT([sqlite],[3.45.2])
22+
AC_INIT([sqlite],[3.45.3])
2323

2424
#--------------------------------------------------------------------
2525
# Call TEA_INIT as the first TEA_ macro to set up initial vars.

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for sqlcipher 3.45.2.
3+
# Generated by GNU Autoconf 2.71 for sqlcipher 3.45.3.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -618,8 +618,8 @@ MAKEFLAGS=
618618
# Identity of this package.
619619
PACKAGE_NAME='sqlcipher'
620620
PACKAGE_TARNAME='sqlcipher'
621-
PACKAGE_VERSION='3.45.2'
622-
PACKAGE_STRING='sqlcipher 3.45.2'
621+
PACKAGE_VERSION='3.45.3'
622+
PACKAGE_STRING='sqlcipher 3.45.3'
623623
PACKAGE_BUGREPORT=''
624624
PACKAGE_URL=''
625625

@@ -1379,7 +1379,7 @@ if test "$ac_init_help" = "long"; then
13791379
# Omit some internal or obsolete options to make the list less imposing.
13801380
# This message is too long to be a string in the A/UX 3.1 sh.
13811381
cat <<_ACEOF
1382-
\`configure' configures sqlcipher 3.45.2 to adapt to many kinds of systems.
1382+
\`configure' configures sqlcipher 3.45.3 to adapt to many kinds of systems.
13831383
13841384
Usage: $0 [OPTION]... [VAR=VALUE]...
13851385
@@ -1445,7 +1445,7 @@ fi
14451445

14461446
if test -n "$ac_init_help"; then
14471447
case $ac_init_help in
1448-
short | recursive ) echo "Configuration of sqlcipher 3.45.2:";;
1448+
short | recursive ) echo "Configuration of sqlcipher 3.45.3:";;
14491449
esac
14501450
cat <<\_ACEOF
14511451
@@ -1588,7 +1588,7 @@ fi
15881588
test -n "$ac_init_help" && exit $ac_status
15891589
if $ac_init_version; then
15901590
cat <<\_ACEOF
1591-
sqlcipher configure 3.45.2
1591+
sqlcipher configure 3.45.3
15921592
generated by GNU Autoconf 2.71
15931593
15941594
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1863,7 +1863,7 @@ cat >config.log <<_ACEOF
18631863
This file contains any messages produced by compilers while
18641864
running configure, to aid debugging if configure makes a mistake.
18651865
1866-
It was created by sqlcipher $as_me 3.45.2, which was
1866+
It was created by sqlcipher $as_me 3.45.3, which was
18671867
generated by GNU Autoconf 2.71. Invocation command line was
18681868
18691869
$ $0$ac_configure_args_raw
@@ -14684,7 +14684,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1468414684
# report actual input values of CONFIG_FILES etc. instead of their
1468514685
# values after options handling.
1468614686
ac_log="
14687-
This file was extended by sqlcipher $as_me 3.45.2, which was
14687+
This file was extended by sqlcipher $as_me 3.45.3, which was
1468814688
generated by GNU Autoconf 2.71. Invocation command line was
1468914689
1469014690
CONFIG_FILES = $CONFIG_FILES
@@ -14752,7 +14752,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
1475214752
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1475314753
ac_cs_config='$ac_cs_config_escaped'
1475414754
ac_cs_version="\\
14755-
sqlcipher config.status 3.45.2
14755+
sqlcipher config.status 3.45.3
1475614756
configured by $0, generated by GNU Autoconf 2.71,
1475714757
with options \\"\$ac_cs_config\\"
1475814758

ext/recover/dbdata.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,15 @@ static void dbdataValue(
494494
}
495495
}
496496

497+
/* This macro is a copy of the MX_CELL() macro in the SQLite core. Given
498+
** a page-size, it returns the maximum number of cells that may be present
499+
** on the page. */
500+
#define DBDATA_MX_CELL(pgsz) ((pgsz-8)/6)
501+
502+
/* Maximum number of fields that may appear in a single record. This is
503+
** the "hard-limit", according to comments in sqliteLimit.h. */
504+
#define DBDATA_MX_FIELD 32676
505+
497506
/*
498507
** Move an sqlite_dbdata or sqlite_dbptr cursor to the next entry.
499508
*/
@@ -522,6 +531,9 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
522531
assert( iOff+3+2<=pCsr->nPage );
523532
pCsr->iCell = pTab->bPtr ? -2 : 0;
524533
pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]);
534+
if( pCsr->nCell>DBDATA_MX_CELL(pCsr->nPage) ){
535+
pCsr->nCell = DBDATA_MX_CELL(pCsr->nPage);
536+
}
525537
}
526538

527539
if( pTab->bPtr ){
@@ -566,19 +578,19 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
566578
if( pCsr->iCell>=pCsr->nCell ){
567579
bNextPage = 1;
568580
}else{
581+
int iCellPtr = iOff + 8 + nPointer + pCsr->iCell*2;
569582

570-
iOff += 8 + nPointer + pCsr->iCell*2;
571-
if( iOff>pCsr->nPage ){
583+
if( iCellPtr>pCsr->nPage ){
572584
bNextPage = 1;
573585
}else{
574-
iOff = get_uint16(&pCsr->aPage[iOff]);
586+
iOff = get_uint16(&pCsr->aPage[iCellPtr]);
575587
}
576588

577589
/* For an interior node cell, skip past the child-page number */
578590
iOff += nPointer;
579591

580592
/* Load the "byte of payload including overflow" field */
581-
if( bNextPage || iOff>pCsr->nPage ){
593+
if( bNextPage || iOff>pCsr->nPage || iOff<=iCellPtr ){
582594
bNextPage = 1;
583595
}else{
584596
iOff += dbdataGetVarintU32(&pCsr->aPage[iOff], &nPayload);
@@ -661,7 +673,9 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
661673
pCsr->iField++;
662674
if( pCsr->iField>0 ){
663675
sqlite3_int64 iType;
664-
if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){
676+
if( pCsr->pHdrPtr>=&pCsr->pRec[pCsr->nRec]
677+
|| pCsr->iField>=DBDATA_MX_FIELD
678+
){
665679
bNextPage = 1;
666680
}else{
667681
int szField = 0;

ext/recover/recovercorrupt2.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,5 +524,33 @@ do_test 7.1 {
524524
list [catch { $R finish } msg] $msg
525525
} {1 {file is not a database}}
526526

527+
reset_db
528+
breakpoint
529+
do_test 8.0 {
530+
sqlite3 db {}
531+
db deserialize [decode_hexdb {
532+
| size 8192 pagesize 4096 filename db.sqlite
533+
| page 1 offset 0
534+
| 0: ac ae b3 76 74 65 20 66 6f 72 6d 61 74 20 33 00 ...vte format 3.
535+
| 16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 02 .....@ ........
536+
| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................
537+
| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
538+
| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................
539+
| 96: 00 2e 76 8a 0d ff ff ff 1e 0f cb 00 0f cb 00 00 ..v.............
540+
| 4032: 00 00 00 00 00 00 00 00 00 00 00 33 01 06 17 19 ...........3....
541+
| 4048: 19 01 43 74 61 62 6c 65 54 61 62 6c 65 30 54 61 ..CtableTable0Ta
542+
| 4064: 62 6c 65 30 02 43 52 45 41 54 45 20 54 41 42 4c ble0.CREATE TABL
543+
| 4080: 45 20 54 61 62 6c 65 30 20 28 43 6f 6c 30 20 29 E Table0 (Col0 )
544+
| page 2 offset 4096
545+
| 0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................
546+
| end db.sqlite
547+
}]} {}
548+
549+
do_test 8.1 {
550+
set R [sqlite3_recover_init db main test.db2]
551+
catch { $R run }
552+
list [catch { $R finish } msg] $msg
553+
} {0 {}}
554+
527555
finish_test
528556

ext/recover/sqlite3recover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ static int recoverWriteSchema1(sqlite3_recover *p){
11891189
if( bTable && !bVirtual ){
11901190
if( SQLITE_ROW==sqlite3_step(pTblname) ){
11911191
const char *zTbl = (const char*)sqlite3_column_text(pTblname, 0);
1192-
recoverAddTable(p, zTbl, iRoot);
1192+
if( zTbl ) recoverAddTable(p, zTbl, iRoot);
11931193
}
11941194
recoverReset(p, pTblname);
11951195
}

ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
12711271
return poolUtil;
12721272
}).catch(async (e)=>{
12731273
await thePool.removeVfs().catch(()=>{});
1274-
return e;
1274+
throw e;
12751275
});
12761276
}).catch((err)=>{
12771277
//error("rejecting promise:",err);

0 commit comments

Comments
 (0)