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/tclsqlite.c | |
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/tclsqlite.c')
-rw-r--r-- | src/tclsqlite.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |