SQLite

Check-in [73d390f3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Correctly handle 8-byte sizes in the JSONB format. Forum post 283daf08e91183fc.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 73d390f39c0bbbc017e01544e4d43c76761f2599bd57f900131c706270dfd202
User & Date: drh 2023-12-06 17:39:31
Context
2023-12-06
17:50
Do correct comparisons between object labels in JSON even when the two labels contain different JSON escapes. (check-in: bda2e30c user: drh tags: trunk)
17:39
Correctly handle 8-byte sizes in the JSONB format. Forum post 283daf08e91183fc. (check-in: 73d390f3 user: drh tags: trunk)
16:27
In CLI, move -interactive flag handling back to arg-loop pass 2. (check-in: 63cb05a8 user: larrybr tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/json.c.

1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802













1803
1804
1805
1806
1807
1808
1809
  }else if( x==13 ){
    if( i+2>=pParse->nBlob ){
      *pSz = 0;
      return 0;
    }
    sz = (pParse->aBlob[i+1]<<8) + pParse->aBlob[i+2];
    n = 3;
  }else{
    if( i+4>=pParse->nBlob ){
      *pSz = 0;
      return 0;
    }
    sz = (pParse->aBlob[i+1]<<24) + (pParse->aBlob[i+2]<<16) +
         (pParse->aBlob[i+3]<<8) + pParse->aBlob[i+4];
    n = 5;













  }
  if( i+sz+n > pParse->nBlob
   && i+sz+n > pParse->nBlob-pParse->delta
  ){
    sz = 0;
    n = 0;
  }







|







>
>
>
>
>
>
>
>
>
>
>
>
>







1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
  }else if( x==13 ){
    if( i+2>=pParse->nBlob ){
      *pSz = 0;
      return 0;
    }
    sz = (pParse->aBlob[i+1]<<8) + pParse->aBlob[i+2];
    n = 3;
  }else if( x==14 ){
    if( i+4>=pParse->nBlob ){
      *pSz = 0;
      return 0;
    }
    sz = (pParse->aBlob[i+1]<<24) + (pParse->aBlob[i+2]<<16) +
         (pParse->aBlob[i+3]<<8) + pParse->aBlob[i+4];
    n = 5;
  }else{
    if( i+8>=pParse->nBlob
     || pParse->aBlob[i+1]!=0
     || pParse->aBlob[i+2]!=0
     || pParse->aBlob[i+3]!=0
     || pParse->aBlob[i+4]!=0
    ){
      *pSz = 0;
      return 0;
    }
    sz = (pParse->aBlob[i+5]<<24) + (pParse->aBlob[i+6]<<16) +
         (pParse->aBlob[i+7]<<8) + pParse->aBlob[i+8];
    n = 9;
  }
  if( i+sz+n > pParse->nBlob
   && i+sz+n > pParse->nBlob-pParse->delta
  ){
    sz = 0;
    n = 0;
  }