From owner-svn-src-releng@freebsd.org Wed Aug 5 17:09:55 2020 Return-Path: Delivered-To: svn-src-releng@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E4C937BBF5; Wed, 5 Aug 2020 17:09:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ5b1tsTz3bRH; Wed, 5 Aug 2020 17:09:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 241AB1943E; Wed, 5 Aug 2020 17:09:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075H9tHA094507; Wed, 5 Aug 2020 17:09:55 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075H9tGP094506; Wed, 5 Aug 2020 17:09:55 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202008051709.075H9tGP094506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 5 Aug 2020 17:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r363920 - releng/12.1/sys/dev/vmware/vmxnet3 X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/12.1/sys/dev/vmware/vmxnet3 X-SVN-Commit-Revision: 363920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:09:55 -0000 Author: gordon Date: Wed Aug 5 17:09:54 2020 New Revision: 363920 URL: https://svnweb.freebsd.org/changeset/base/363920 Log: Fix vmx driver packet loss and degraded performance. Approved by: so Security: FreeBSD-EN-20:16.vmx Modified: releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Modified: releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Wed Aug 5 17:08:02 2020 (r363919) +++ releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Wed Aug 5 17:09:54 2020 (r363920) @@ -1320,7 +1320,7 @@ vmxnet3_isc_txd_encap(void *vsc, if_pkt_info_t pi) hdrlen = pi->ipi_ehdrlen + pi->ipi_ip_hlen; if (pi->ipi_csum_flags & CSUM_TSO) { sop->offload_mode = VMXNET3_OM_TSO; - sop->hlen = hdrlen; + sop->hlen = hdrlen + pi->ipi_tcp_hlen; sop->offload_pos = pi->ipi_tso_segsz; } else if (pi->ipi_csum_flags & (VMXNET3_CSUM_OFFLOAD | VMXNET3_CSUM_OFFLOAD_IPV6)) { From owner-svn-src-releng@freebsd.org Wed Aug 5 17:11:19 2020 Return-Path: Delivered-To: svn-src-releng@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7D2137BF12; Wed, 5 Aug 2020 17:11:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ7C4TFrz3bT6; Wed, 5 Aug 2020 17:11:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D1601934F; Wed, 5 Aug 2020 17:11:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075HBJST096498; Wed, 5 Aug 2020 17:11:19 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075HBIgl096493; Wed, 5 Aug 2020 17:11:18 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202008051711.075HBIgl096493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 5 Aug 2020 17:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r363921 - in releng: 11.3/sys/dev/usb/net 11.4/sys/dev/usb/net 12.1/sys/dev/usb/net X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/dev/usb/net 11.4/sys/dev/usb/net 12.1/sys/dev/usb/net X-SVN-Commit-Revision: 363921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:11:19 -0000 Author: gordon Date: Wed Aug 5 17:11:18 2020 New Revision: 363921 URL: https://svnweb.freebsd.org/changeset/base/363921 Log: Fix memory corruption in USB network device drivers. Approved by: so Security: FreeBSD-SA-20:21.usb_net Security: CVE-2020-7459 Modified: releng/11.3/sys/dev/usb/net/if_smsc.c releng/11.4/sys/dev/usb/net/if_smsc.c releng/12.1/sys/dev/usb/net/if_cdceem.c releng/12.1/sys/dev/usb/net/if_muge.c releng/12.1/sys/dev/usb/net/if_smsc.c Modified: releng/11.3/sys/dev/usb/net/if_smsc.c ============================================================================== --- releng/11.3/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/11.3/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:11:18 2020 (r363921) @@ -970,7 +970,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -996,6 +996,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1024,7 +1027,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ Modified: releng/11.4/sys/dev/usb/net/if_smsc.c ============================================================================== --- releng/11.4/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/11.4/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:11:18 2020 (r363921) @@ -970,7 +970,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -996,6 +996,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1024,7 +1027,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ Modified: releng/12.1/sys/dev/usb/net/if_cdceem.c ============================================================================== --- releng/12.1/sys/dev/usb/net/if_cdceem.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/12.1/sys/dev/usb/net/if_cdceem.c Wed Aug 5 17:11:18 2020 (r363921) @@ -426,9 +426,10 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr struct usb_ether *ue; struct ifnet *ifp; struct mbuf *m; - int actlen, off; uint32_t computed_crc, received_crc; - uint16_t pktlen; + int pktlen; + int actlen; + int off; off = *offp; sc = usbd_xfer_softc(xfer); @@ -442,7 +443,7 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr (hdr & CDCEEM_DATA_CRC) ? "valid" : "absent", pktlen); - if (pktlen < ETHER_HDR_LEN) { + if (pktlen < (ETHER_HDR_LEN + 4)) { CDCEEM_WARN(sc, "bad ethernet frame length %d, should be at least %d", pktlen, ETHER_HDR_LEN); @@ -466,6 +467,14 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr } pktlen -= 4; /* Subtract the CRC. */ + + if (pktlen > m->m_len) { + CDCEEM_WARN(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + return; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); off += pktlen; @@ -512,7 +521,7 @@ cdceem_bulk_read_callback(struct usb_xfer *xfer, usb_e pc = usbd_xfer_get_frame(xfer, 0); off = 0; - while (off < actlen) { + while ((off + sizeof(hdr)) <= actlen) { usbd_copy_out(pc, off, &hdr, sizeof(hdr)); CDCEEM_DEBUG(sc, "hdr = %#x", hdr); off += sizeof(hdr); Modified: releng/12.1/sys/dev/usb/net/if_muge.c ============================================================================== --- releng/12.1/sys/dev/usb/net/if_muge.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/12.1/sys/dev/usb/net/if_muge.c Wed Aug 5 17:11:18 2020 (r363921) @@ -1167,9 +1167,9 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err struct ifnet *ifp = uether_getifp(ue); struct mbuf *m; struct usb_page_cache *pc; - uint16_t pktlen; uint32_t rx_cmd_a, rx_cmd_b; uint16_t rx_cmd_c; + int pktlen; int off; int actlen; @@ -1251,7 +1251,14 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err 1); goto tr_setup; } - + if (pktlen > m->m_len) { + muge_dbg_printf(sc, + "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); Modified: releng/12.1/sys/dev/usb/net/if_smsc.c ============================================================================== --- releng/12.1/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/12.1/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:11:18 2020 (r363921) @@ -973,7 +973,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -999,6 +999,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1027,7 +1030,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ From owner-svn-src-releng@freebsd.org Wed Aug 5 17:13:11 2020 Return-Path: Delivered-To: svn-src-releng@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA81337BDF1; Wed, 5 Aug 2020 17:13:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ9M4Pflz3bsm; Wed, 5 Aug 2020 17:13:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A27E1979D; Wed, 5 Aug 2020 17:13:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075HDBR7000441; Wed, 5 Aug 2020 17:13:11 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075HDAPq000436; Wed, 5 Aug 2020 17:13:10 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202008051713.075HDAPq000436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 5 Aug 2020 17:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r363922 - in releng: 11.3/contrib/sqlite3 11.3/contrib/sqlite3/tea 11.3/contrib/sqlite3/tea/generic 11.3/contrib/sqlite3/tea/win 11.4/contrib/sqlite3 11.4/contrib/sqlite3/tea 11.4/contr... X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/contrib/sqlite3 11.3/contrib/sqlite3/tea 11.3/contrib/sqlite3/tea/generic 11.3/contrib/sqlite3/tea/win 11.4/contrib/sqlite3 11.4/contrib/sqlite3/tea 11.4/contrib/sqlite3/tea/generic 11... X-SVN-Commit-Revision: 363922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:13:11 -0000 Author: gordon Date: Wed Aug 5 17:13:08 2020 New Revision: 363922 URL: https://svnweb.freebsd.org/changeset/base/363922 Log: Fix multiple vulnerabilities in sqlite3. Approved by: so Security: FreeBSD-SA-20:22.sqlite Security: CVE-2020-11655 Security: CVE-2020-11656 Security: CVE-2020-13434 Security: CVE-2020-13435 Security: CVE-2020-13630 Security: CVE-2020-13631 Security: CVE-2020-13632 Modified: releng/11.3/contrib/sqlite3/Makefile.msc releng/11.3/contrib/sqlite3/configure releng/11.3/contrib/sqlite3/configure.ac releng/11.3/contrib/sqlite3/shell.c releng/11.3/contrib/sqlite3/sqlite3.c releng/11.3/contrib/sqlite3/sqlite3.h releng/11.3/contrib/sqlite3/sqlite3ext.h releng/11.3/contrib/sqlite3/tea/configure releng/11.3/contrib/sqlite3/tea/configure.ac releng/11.3/contrib/sqlite3/tea/generic/tclsqlite3.c releng/11.3/contrib/sqlite3/tea/win/makefile.vc releng/11.4/contrib/sqlite3/Makefile.msc releng/11.4/contrib/sqlite3/configure releng/11.4/contrib/sqlite3/configure.ac releng/11.4/contrib/sqlite3/shell.c releng/11.4/contrib/sqlite3/sqlite3.c releng/11.4/contrib/sqlite3/sqlite3.h releng/11.4/contrib/sqlite3/sqlite3ext.h releng/11.4/contrib/sqlite3/tea/configure releng/11.4/contrib/sqlite3/tea/configure.ac releng/11.4/contrib/sqlite3/tea/generic/tclsqlite3.c releng/11.4/contrib/sqlite3/tea/win/makefile.vc releng/12.1/contrib/sqlite3/Makefile.msc releng/12.1/contrib/sqlite3/configure releng/12.1/contrib/sqlite3/configure.ac releng/12.1/contrib/sqlite3/shell.c releng/12.1/contrib/sqlite3/sqlite3.c releng/12.1/contrib/sqlite3/sqlite3.h releng/12.1/contrib/sqlite3/sqlite3ext.h releng/12.1/contrib/sqlite3/tea/configure releng/12.1/contrib/sqlite3/tea/configure.ac releng/12.1/contrib/sqlite3/tea/generic/tclsqlite3.c releng/12.1/contrib/sqlite3/tea/win/makefile.vc Modified: releng/11.3/contrib/sqlite3/Makefile.msc ============================================================================== --- releng/11.3/contrib/sqlite3/Makefile.msc Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/Makefile.msc Wed Aug 5 17:13:08 2020 (r363922) @@ -73,7 +73,7 @@ API_ARMOR = 0 !IFNDEF NO_WARN !IF $(USE_FULLWARN)!=0 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206 -NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706 +NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706 !ENDIF !ENDIF @@ -196,6 +196,7 @@ OSTRACE = 0 DEBUG = 0 !ENDIF + # Enable use of available compiler optimizations? Normally, this should be # non-zero. Setting this to zero, thus disabling all compiler optimizations, # can be useful for testing. @@ -210,6 +211,12 @@ OPTIMIZATIONS = 2 SESSION = 0 !ENDIF +# Set this to non-0 to enable support for the rbu extension. +# +!IFNDEF RBU +RBU = 0 +!ENDIF + # Set the source code file to be used by executables and libraries when # they need the amalgamation. # @@ -282,7 +289,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 @@ -296,6 +303,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Should the rbu extension be enabled? If so, add compilation options +# to enable it. +# +!IF $(RBU)!=0 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1 +!ENDIF + # These are the "extended" SQLite compilation options used when compiling for # the Windows 10 platform. # @@ -978,7 +992,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: releng/11.3/contrib/sqlite3/configure ============================================================================== --- releng/11.3/contrib/sqlite3/configure Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/configure Wed Aug 5 17:13:08 2020 (r363922) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.28.0' -PACKAGE_STRING='sqlite 3.28.0' +PACKAGE_VERSION='3.32.2' +PACKAGE_STRING='sqlite 3.32.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.28.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.28.0:";; + short | recursive ) echo "Configuration of sqlite 3.32.2:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.28.0 +sqlite configure 3.32.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.28.0, which was +It was created by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.28.0' + VERSION='3.32.2' cat >>confdefs.h <<_ACEOF @@ -13653,7 +13653,7 @@ else fi if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.28.0, which was +This file was extended by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.28.0 +sqlite config.status 3.32.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: releng/11.3/contrib/sqlite3/configure.ac ============================================================================== --- releng/11.3/contrib/sqlite3/configure.ac Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/configure.ac Wed Aug 5 17:13:08 2020 (r363922) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.32.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -161,7 +161,7 @@ AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- Modified: releng/11.3/contrib/sqlite3/shell.c ============================================================================== --- releng/11.3/contrib/sqlite3/shell.c Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/shell.c Wed Aug 5 17:13:08 2020 (r363922) @@ -36,6 +36,14 @@ #endif /* +** Determine if we are dealing with WinRT, which provides only a subset of +** the full Win32 API. +*/ +#if !defined(SQLITE_OS_WINRT) +# define SQLITE_OS_WINRT 0 +#endif + +/* ** Warning pragmas copied from msvc.h in the core. */ #if defined(_MSC_VER) @@ -147,22 +155,26 @@ typedef unsigned char u8; #if defined(_WIN32) || defined(WIN32) -# include -# include -# define isatty(h) _isatty(h) -# ifndef access -# define access(f,m) _access((f),(m)) +# if SQLITE_OS_WINRT +# define SQLITE_OMIT_POPEN 1 +# else +# include +# include +# define isatty(h) _isatty(h) +# ifndef access +# define access(f,m) _access((f),(m)) +# endif +# ifndef unlink +# define unlink _unlink +# endif +# ifndef strdup +# define strdup _strdup +# endif +# undef popen +# define popen _popen +# undef pclose +# define pclose _pclose # endif -# ifndef unlink -# define unlink _unlink -# endif -# ifndef strdup -# define strdup _strdup -# endif -# undef popen -# define popen _popen -# undef pclose -# define pclose _pclose #else /* Make sure isatty() has a prototype. */ extern int isatty(int); @@ -191,6 +203,9 @@ typedef unsigned char u8; #define ToLower(X) (char)tolower((unsigned char)X) #if defined(_WIN32) || defined(WIN32) +#if SQLITE_OS_WINRT +#include +#endif #include /* string conversion routines only needed on Win32 */ @@ -206,7 +221,7 @@ extern LPWSTR sqlite3_win32_utf8_to_unicode(const char ** rendering quoted strings that contain \n characters). The following ** routines take care of that. */ -#if defined(_WIN32) || defined(WIN32) +#if (defined(_WIN32) || defined(WIN32)) && !SQLITE_OS_WINRT static void setBinaryMode(FILE *file, int isOutput){ if( isOutput ) fflush(file); _setmode(_fileno(file), _O_BINARY); @@ -310,6 +325,7 @@ static int hasTimer(void){ if( getProcessTimesAddr ){ return 1; } else { +#if !SQLITE_OS_WINRT /* GetProcessTimes() isn't supported in WIN95 and some other Windows ** versions. See if the version we are running on has it, and if it ** does, save off a pointer to it and the current process handle. @@ -326,6 +342,7 @@ static int hasTimer(void){ FreeLibrary(hinstLib); } } +#endif } return 0; } @@ -415,7 +432,16 @@ static sqlite3 *globalDb = 0; */ static volatile int seenInterrupt = 0; +#ifdef SQLITE_DEBUG /* +** Out-of-memory simulator variables +*/ +static unsigned int oomCounter = 0; /* Simulate OOM when equals 1 */ +static unsigned int oomRepeat = 0; /* Number of OOMs in a row */ +static void*(*defaultMalloc)(int) = 0; /* The low-level malloc routine */ +#endif /* SQLITE_DEBUG */ + +/* ** This is the name of our program. It is set in main(), used ** in a number of other places, mostly for error messages. */ @@ -466,6 +492,49 @@ static void shell_out_of_memory(void){ exit(1); } +#ifdef SQLITE_DEBUG +/* This routine is called when a simulated OOM occurs. It is broken +** out as a separate routine to make it easy to set a breakpoint on +** the OOM +*/ +void shellOomFault(void){ + if( oomRepeat>0 ){ + oomRepeat--; + }else{ + oomCounter--; + } +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* This routine is a replacement malloc() that is used to simulate +** Out-Of-Memory (OOM) errors for testing purposes. +*/ +static void *oomMalloc(int nByte){ + if( oomCounter ){ + if( oomCounter==1 ){ + shellOomFault(); + return 0; + }else{ + oomCounter--; + } + } + return defaultMalloc(nByte); +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* Register the OOM simulator. This must occur before any memory +** allocations */ +static void registerOomSimulator(void){ + sqlite3_mem_methods mem; + sqlite3_config(SQLITE_CONFIG_GETMALLOC, &mem); + defaultMalloc = mem.xMalloc; + mem.xMalloc = oomMalloc; + sqlite3_config(SQLITE_CONFIG_MALLOC, &mem); +} +#endif + /* ** Write I/O traces to the following stream. */ @@ -983,6 +1052,7 @@ static void shellAddSchemaName( ** We need several support functions from the SQLite core. */ +/* #include "sqlite3.h" */ /* ** We need several things from the ANSI and MSVCRT headers. @@ -1336,6 +1406,7 @@ INT closedir( ** is used. If SIZE is included it must be one of the integers 224, 256, ** 384, or 512, to determine SHA3 hash variant that is computed. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -2005,19 +2076,23 @@ int sqlite3_shathree_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sha3", 1, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 1, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 2, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 1, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 2, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } return rc; } @@ -2099,6 +2174,7 @@ int sqlite3_shathree_init( ** And the paths returned in the "name" column of the table are also ** relative to directory $dir. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -2419,6 +2495,7 @@ static int writeFile( if( mtime>=0 ){ #if defined(_WIN32) +#if !SQLITE_OS_WINRT /* Windows */ FILETIME lastAccess; FILETIME lastWrite; @@ -2449,6 +2526,7 @@ static int writeFile( }else{ return 1; } +#endif #elif defined(AT_FDCWD) && 0 /* utimensat() is not universally available */ /* Recent unix */ struct timespec times[2]; @@ -2610,6 +2688,7 @@ static int fsdirConnect( pNew = (fsdir_tab*)sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); } *ppVtab = (sqlite3_vtab*)pNew; return rc; @@ -3003,10 +3082,12 @@ int sqlite3_fileio_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "readfile", 1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, readfileFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "writefile", -1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "writefile", -1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, writefileFunc, 0, 0); } if( rc==SQLITE_OK ){ @@ -3056,6 +3137,7 @@ int sqlite3_fileio_init( ** faster than any human can type. ** */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -3140,6 +3222,7 @@ static int completionConnect( #define COMPLETION_COLUMN_WHOLELINE 2 /* Entire line seen so far */ #define COMPLETION_COLUMN_PHASE 3 /* ePhase - used for debugging only */ + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); rc = sqlite3_declare_vtab(db, "CREATE TABLE x(" " candidate TEXT," @@ -3572,6 +3655,7 @@ int sqlite3_completion_init( ** If the file being opened is not an appended database, then this shim is ** a pass-through into the default underlying VFS. **/ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -4200,6 +4284,101 @@ int sqlite3MemTraceDeactivate(void){ } /************************* End ../ext/misc/memtrace.c ********************/ +/************************* Begin ../ext/misc/uint.c ******************/ +/* +** 2020-04-14 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This SQLite extension implements the UINT collating sequence. +** +** UINT works like BINARY for text, except that embedded strings +** of digits compare in numeric order. +** +** * Leading zeros are handled properly, in the sense that +** they do not mess of the maginitude comparison of embedded +** strings of digits. "x00123y" is equal to "x123y". +** +** * Only unsigned integers are recognized. Plus and minus +** signs are ignored. Decimal points and exponential notation +** are ignored. +** +** * Embedded integers can be of arbitrary length. Comparison +** is *not* limited integers that can be expressed as a +** 64-bit machine integer. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include +#include + +/* +** Compare text in lexicographic order, except strings of digits +** compare in numeric order. +*/ +static int uintCollFunc( + void *notUsed, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + const unsigned char *zA = (const unsigned char*)pKey1; + const unsigned char *zB = (const unsigned char*)pKey2; + int i=0, j=0, x; + (void)notUsed; + while( i #include @@ -4572,6 +4752,7 @@ static int zipfileConnect( zipfileDequote(pNew->zFile); } } + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); *ppVtab = (sqlite3_vtab*)pNew; return rc; } @@ -5184,25 +5365,25 @@ static int zipfileDeflate( u8 **ppOut, int *pnOut, /* Output */ char **pzErr /* OUT: Error message */ ){ - sqlite3_int64 nAlloc = compressBound(nIn); - u8 *aOut; int rc = SQLITE_OK; + sqlite3_int64 nAlloc; + z_stream str; + u8 *aOut; + memset(&str, 0, sizeof(str)); + str.next_in = (Bytef*)aIn; + str.avail_in = nIn; + deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); + + nAlloc = deflateBound(&str, nIn); aOut = (u8*)sqlite3_malloc64(nAlloc); if( aOut==0 ){ rc = SQLITE_NOMEM; }else{ int res; - z_stream str; - memset(&str, 0, sizeof(str)); - str.next_in = (Bytef*)aIn; - str.avail_in = nIn; str.next_out = aOut; str.avail_out = nAlloc; - - deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); res = deflate(&str, Z_FINISH); - if( res==Z_STREAM_END ){ *ppOut = aOut; *pnOut = (int)str.total_out; @@ -5511,10 +5692,10 @@ static int zipfileBestIndex( idx = i; } } + pIdxInfo->estimatedCost = 1000.0; if( idx>=0 ){ pIdxInfo->aConstraintUsage[idx].argvIndex = 1; pIdxInfo->aConstraintUsage[idx].omit = 1; - pIdxInfo->estimatedCost = 1000.0; pIdxInfo->idxNum = 1; }else if( unusable ){ return SQLITE_CONSTRAINT; @@ -5636,8 +5817,8 @@ static int zipfileGetMode( ** identical, ignoring any trailing '/' character in either path. */ static int zipfileComparePath(const char *zA, const char *zB, int nB){ int nA = (int)strlen(zA); - if( zA[nA-1]=='/' ) nA--; - if( zB[nB-1]=='/' ) nB--; + if( nA>0 && zA[nA-1]=='/' ) nA--; + if( nB>0 && zB[nB-1]=='/' ) nB--; if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0; return 1; } @@ -5647,6 +5828,10 @@ static int zipfileBegin(sqlite3_vtab *pVtab){ int rc = SQLITE_OK; assert( pTab->pWriteFd==0 ); + if( pTab->zFile==0 || pTab->zFile[0]==0 ){ + pTab->base.zErrMsg = sqlite3_mprintf("zipfile: missing filename"); + return SQLITE_ERROR; + } /* Open a write fd on the file. Also load the entire central directory ** structure into memory. During the transaction any new file data is @@ -5821,6 +6006,7 @@ static int zipfileUpdate( if( rc==SQLITE_OK ){ zPath = (const char*)sqlite3_value_text(apVal[2]); + if( zPath==0 ) zPath = ""; nPath = (int)strlen(zPath); mTime = zipfileGetTime(apVal[4]); } @@ -5830,11 +6016,15 @@ static int zipfileUpdate( ** '/'. This appears to be required for compatibility with info-zip ** (the unzip command on unix). It does not create directories ** otherwise. */ - if( zPath[nPath-1]!='/' ){ + if( nPath<=0 || zPath[nPath-1]!='/' ){ zFree = sqlite3_mprintf("%s/", zPath); - if( zFree==0 ){ rc = SQLITE_NOMEM; } zPath = (const char*)zFree; - nPath++; + if( zFree==0 ){ + rc = SQLITE_NOMEM; + nPath = 0; + }else{ + nPath = (int)strlen(zPath); + } } } @@ -6227,19 +6417,19 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqli ** at the end of the path. Or, if this is not a directory and the path ** ends in '/' it is an error. */ if( bIsDir==0 ){ - if( zName[nName-1]=='/' ){ + if( nName>0 && zName[nName-1]=='/' ){ zErr = sqlite3_mprintf("non-directory name must not end with /"); rc = SQLITE_ERROR; goto zipfile_step_out; } }else{ - if( zName[nName-1]!='/' ){ + if( nName==0 || zName[nName-1]!='/' ){ zName = zFree = sqlite3_mprintf("%s/", zName); - nName++; if( zName==0 ){ rc = SQLITE_NOMEM; goto zipfile_step_out; } + nName = (int)strlen(zName); }else{ while( nName>1 && zName[nName-2]=='/' ) nName--; } @@ -6398,8 +6588,10 @@ int sqlite3_zipfile_init( ** for working with sqlar archives and used by the shell tool's built-in ** sqlar support. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include +#include /* ** Implementation of the "sqlar_compress(X)" SQL function. @@ -6494,10 +6686,12 @@ int sqlite3_sqlar_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sqlar_compress", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_compress", 1, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarCompressFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sqlar_uncompress", 2, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_uncompress", 2, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarUncompressFunc, 0, 0); } return rc; @@ -6518,9 +6712,10 @@ int sqlite3_sqlar_init( ** ************************************************************************* */ +#if !defined(SQLITEEXPERT_H) +#define SQLITEEXPERT_H 1 +/* #include "sqlite3.h" */ - - typedef struct sqlite3expert sqlite3expert; /* @@ -6672,8 +6867,8 @@ const char *sqlite3_expert_report(sqlite3expert*, int */ void sqlite3_expert_destroy(sqlite3expert*); +#endif /* !defined(SQLITEEXPERT_H) */ - /************************* End ../ext/expert/sqlite3expert.h ********************/ /************************* Begin ../ext/expert/sqlite3expert.c ******************/ /* @@ -6688,6 +6883,7 @@ void sqlite3_expert_destroy(sqlite3expert*); ** ************************************************************************* */ +/* #include "sqlite3expert.h" */ #include #include #include @@ -7805,14 +8001,19 @@ int idxFindIndexes( /* int iParent = sqlite3_column_int(pExplain, 1); */ /* int iNotUsed = sqlite3_column_int(pExplain, 2); */ const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3); - int nDetail = STRLEN(zDetail); + int nDetail; int i; + if( !zDetail ) continue; + nDetail = STRLEN(zDetail); + for(i=0; i