In tclsqlite.c, function DbMain()... somewhere between 3.19 and 3.23 there was 
a re-write of the argument parsing code for the sqlite command, and following 
code was removed and not completely replaced with a new equivalent:


  if( objc<3 || (objc&1)!=1 ){

    Tcl_WrongNumArgs(interp, 1, objv,

      "HANDLE FILENAME ?-vfs VFSNAME? ?-readonly BOOLEAN? ?-create BOOLEAN?"

      " ?-nomutex BOOLEAN? ?-fullmutex BOOLEAN? ?-uri BOOLEAN?"

#if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_CODEC_FROM_TCL)

      " ?-key CODECKEY?"

#endif

    );

    return TCL_ERROR;

  }

The result is that if you use the sqlite command with no arguments it core 
dumps on the code following, where it tries to use objv[1], instead of 
returning an error.


$ tclsh

% package require sqlite3

3.24.0

% sqlite3

Segmentation fault (core dumped)

It looks like there is an attempt to handle missing arguments at the top of the 
“for(i=2; i<objc; i++)” loop but if there are no arguments that code is 
bypassed.

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to