SQLite

Check-in [2779f9270c]
Login

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

Overview
Comment:Make CLI .load slightly harder to abuse.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2779f9270cc431786d0e16ef05ec05b0f22dda2307f3bf17467ad0b25304e160
User & Date: larrybr 2023-04-28 00:28:06.476
Context
2023-04-28
10:10
Do not assert() a bad string representation in an sqlite3_value after an OOM. dbsqlfuzz c822a17a23c524a0ac7cfb203c7198209da15de8. (check-in: 91fee79a01 user: drh tags: trunk)
00:28
Make CLI .load slightly harder to abuse. (check-in: 2779f9270c user: larrybr tags: trunk)
00:19
In the CLI, early out from the output_quoted_string() routine if the input string is NULL. forum post 8a22c0bfa7. (check-in: 2881978d7b user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/shell.c.in.
9188
9189
9190
9191
9192
9193
9194
9195

9196
9197
9198
9199
9200
9201
9202
  }else

#if !defined(SQLITE_OMIT_LOAD_EXTENSION) && !defined(SQLITE_SHELL_FIDDLE)
  if( c=='l' && cli_strncmp(azArg[0], "load", n)==0 ){
    const char *zFile, *zProc;
    char *zErrMsg = 0;
    failIfSafeMode(p, "cannot run .load in safe mode");
    if( nArg<2 ){

      raw_printf(stderr, "Usage: .load FILE ?ENTRYPOINT?\n");
      rc = 1;
      goto meta_command_exit;
    }
    zFile = azArg[1];
    zProc = nArg>=3 ? azArg[2] : 0;
    open_db(p, 0);







|
>







9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
  }else

#if !defined(SQLITE_OMIT_LOAD_EXTENSION) && !defined(SQLITE_SHELL_FIDDLE)
  if( c=='l' && cli_strncmp(azArg[0], "load", n)==0 ){
    const char *zFile, *zProc;
    char *zErrMsg = 0;
    failIfSafeMode(p, "cannot run .load in safe mode");
    if( nArg<2 || azArg[1][0]==0 ){
      /* Must have a non-empty FILE. (Will not load self.) */
      raw_printf(stderr, "Usage: .load FILE ?ENTRYPOINT?\n");
      rc = 1;
      goto meta_command_exit;
    }
    zFile = azArg[1];
    zProc = nArg>=3 ? azArg[2] : 0;
    open_db(p, 0);