/ Check-in [dff823ca]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix harmless compiler warning in the session extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: dff823ca8b5ca4a5611407b0231f89b2e8c981f50e85e361e76d3e4973cea8ca
User & Date: mistachkin 2019-05-16 03:47:38
Context
2019-05-16
11:47
Fix a harmless use-of-initialized-value fault in the assert() logic added by check-in [d612fb7873cf59d] check-in: 3dac9072 user: drh tags: trunk
03:47
Fix harmless compiler warning in the session extension. check-in: dff823ca user: mistachkin tags: trunk
01:22
Make sure the OP_Concat opcode always correctly zero-terminates a UTF16 string, even if the input strings are ill-formed. This is a followup to check-in [3a16ddf91f0c9c516a7] that fixes a case the previous check-in missed. Also add assert()s to prove correct zero termination. check-in: d612fb78 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/session/sqlite3session.c.

  1826   1826   ** Ensure that there is room in the buffer to append nByte bytes of data.
  1827   1827   ** If not, use sqlite3_realloc() to grow the buffer so that there is.
  1828   1828   **
  1829   1829   ** If successful, return zero. Otherwise, if an OOM condition is encountered,
  1830   1830   ** set *pRc to SQLITE_NOMEM and return non-zero.
  1831   1831   */
  1832   1832   static int sessionBufferGrow(SessionBuffer *p, size_t nByte, int *pRc){
  1833         -  if( *pRc==SQLITE_OK && p->nAlloc-p->nBuf<nByte ){
         1833  +  if( *pRc==SQLITE_OK && (size_t)(p->nAlloc-p->nBuf)<nByte ){
  1834   1834       u8 *aNew;
  1835   1835       i64 nNew = p->nAlloc ? p->nAlloc : 128;
  1836   1836       do {
  1837   1837         nNew = nNew*2;
  1838   1838       }while( (nNew-p->nBuf)<nByte );
  1839   1839   
  1840   1840       aNew = (u8 *)sqlite3_realloc64(p->aBuf, nNew);