diff options
author | drh <drh@noemail.net> | 2018-01-03 23:40:02 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-01-03 23:40:02 +0000 |
commit | a5bb43518b406098d4545c98fcffc80724c9f1fc (patch) | |
tree | 485180f51c0e013f3cf7e8c411eba66b311d1485 /src | |
parent | 99abe5c478d5340616bc9418f7fd7c07b33dedfe (diff) | |
download | sqlite-a5bb43518b406098d4545c98fcffc80724c9f1fc.tar.gz sqlite-a5bb43518b406098d4545c98fcffc80724c9f1fc.zip |
New test cases and fixes for minor problems.
FossilOrigin-Name: e0da2cc382e0db33d0423372133115f52c77bd0093dbf816c7e88a0aad5f6582
Diffstat (limited to 'src')
-rw-r--r-- | src/attach.c | 1 | ||||
-rw-r--r-- | src/tclsqlite.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/attach.c b/src/attach.c index f177f1a5b..597351fa3 100644 --- a/src/attach.c +++ b/src/attach.c @@ -229,6 +229,7 @@ static void attachFunc( */ if( rc==SQLITE_OK ){ sqlite3BtreeEnterAll(db); + db->init.iDb = 0; rc = sqlite3Init(db, &zErrDyn); sqlite3BtreeLeaveAll(db); } diff --git a/src/tclsqlite.c b/src/tclsqlite.c index c9b4ff610..f3261d1e7 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -2442,11 +2442,11 @@ static int SQLITE_TCLAPI DbObjCmd( } pBA = Tcl_GetByteArrayFromObj(pValue, &len); pData = sqlite3_malloc64( len ); - if( pData==0 ){ + if( pData==0 && len>0 ){ Tcl_AppendResult(interp, "out of memory", (char*)0); rc = TCL_ERROR; }else{ - memcpy(pData, pBA, len); + if( len>0 ) memcpy(pData, pBA, len); xrc = sqlite3_deserialize(pDb->db, zSchema, pData, len, len, SQLITE_DESERIALIZE_FREEONCLOSE | SQLITE_DESERIALIZE_RESIZEABLE); |