SQLite

Check-in [cb12ac5d]
Login

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

Overview
Comment:Extra OOM check in shell_error_context() of the CLI. forum post 5708841db0.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cb12ac5de17e677f089d7b0b46803efbd9a9178972ffb0454a8b557b06633658
User & Date: drh 2022-10-31 01:22:38
Context
2022-10-31
18:04
Extra OOM check in shell_error_context() of the CLI. forum post 5708841db0. (check-in: d6893183 user: drh tags: branch-3.39)
10:53
Avoid a segfault that could occur when running the recover API on a database handle with memory-mapping enabled. (check-in: e02c6972 user: dan tags: trunk)
01:22
Extra OOM check in shell_error_context() of the CLI. forum post 5708841db0. (check-in: cb12ac5d user: drh tags: trunk)
2022-10-30
11:39
Add oo1.DB.selectArray() and selectObject(). (check-in: 7660db2a user: stephan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

2660
2661
2662
2663
2664
2665
2666

2667
2668
2669
2670
2671
2672
2673
  }
  len = strlen(zSql);
  if( len>78 ){
    len = 78;
    while( (zSql[len]&0xc0)==0x80 ) len--;
  }
  zCode = sqlite3_mprintf("%.*s", len, zSql);

  for(i=0; zCode[i]; i++){ if( IsSpace(zSql[i]) ) zCode[i] = ' '; }
  if( iOffset<25 ){
    zMsg = sqlite3_mprintf("\n  %z\n  %*s^--- error here", zCode, iOffset, "");
  }else{
    zMsg = sqlite3_mprintf("\n  %z\n  %*serror here ---^", zCode, iOffset-14, "");
  }
  return zMsg;







>







2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
  }
  len = strlen(zSql);
  if( len>78 ){
    len = 78;
    while( (zSql[len]&0xc0)==0x80 ) len--;
  }
  zCode = sqlite3_mprintf("%.*s", len, zSql);
  shell_check_oom(zCode);
  for(i=0; zCode[i]; i++){ if( IsSpace(zSql[i]) ) zCode[i] = ' '; }
  if( iOffset<25 ){
    zMsg = sqlite3_mprintf("\n  %z\n  %*s^--- error here", zCode, iOffset, "");
  }else{
    zMsg = sqlite3_mprintf("\n  %z\n  %*serror here ---^", zCode, iOffset-14, "");
  }
  return zMsg;