/ Check-in [eec3187b]
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:Remove unnecessary memset() calls from test code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eec3187bc68ddebdbc2113f77c7f5cd32e9be61f
User & Date: drh 2013-10-03 11:27:56
Context
2013-10-03
12:29
Return an error if an attempt is made to create a trigger with an SQL variable embedded within it. If such a variable reference is found within a trigger definition loaded from the sqlite_master table, silently replace it with a NULL. check-in: f35f6ae3 user: dan tags: trunk
11:27
Remove unnecessary memset() calls from test code. check-in: eec3187b user: drh tags: trunk
2013-10-02
20:46
In the lemon parser generator, change all hashes to unsigned to avoid potential problems with signed integer overflow. check-in: 8d399a03 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/tclsqlite.c.

  3373   3373           /* Append length in bits and transform */
  3374   3374           ((uint32 *)ctx->in)[ 14 ] = ctx->bits[0];
  3375   3375           ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1];
  3376   3376   
  3377   3377           MD5Transform(ctx->buf, (uint32 *)ctx->in);
  3378   3378           byteReverse((unsigned char *)ctx->buf, 4);
  3379   3379           memcpy(digest, ctx->buf, 16);
  3380         -        memset(ctx, 0, sizeof(ctx));    /* In case it is sensitive */
  3381   3380   }
  3382   3381   
  3383   3382   /*
  3384   3383   ** Convert a 128-bit MD5 digest into a 32-digit base-16 number.
  3385   3384   */
  3386   3385   static void MD5DigestToBase16(unsigned char *digest, char *zBuf){
  3387   3386     static char const zEncode[] = "0123456789abcdef";

Changes to src/test_init.c.

   215    215     Tcl_Obj *CONST objv[]  /* Command arguments */
   216    216   ){
   217    217     if( objc!=1 ){
   218    218       Tcl_WrongNumArgs(interp, 1, objv, "");
   219    219       return TCL_ERROR;
   220    220     }
   221    221   
   222         -  memset(&wrapped, 0, sizeof(&wrapped));
   223    222     sqlite3_shutdown();
   224    223     sqlite3_config(SQLITE_CONFIG_MUTEX, &wrapped.mutex);
   225    224     sqlite3_config(SQLITE_CONFIG_MALLOC, &wrapped.mem);
   226    225     sqlite3_config(SQLITE_CONFIG_PCACHE2, &wrapped.pcache);
   227    226     return TCL_OK;
   228    227   }
   229    228