mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
In the blob test code, avoid crashing on low-memory systems by using Tcl_AttemptAlloc().
FossilOrigin-Name: 1d267757a89d9267ee9c201373f801eb9772ab04
This commit is contained in:
@@ -239,7 +239,11 @@ static int SQLITE_TCLAPI test_blob_read(
|
||||
}
|
||||
|
||||
if( nByte>0 ){
|
||||
zBuf = (unsigned char *)Tcl_Alloc(nByte);
|
||||
zBuf = (unsigned char *)Tcl_AttemptAlloc(nByte);
|
||||
if( zBuf==0 ){
|
||||
Tcl_AppendResult(interp, "out of memory", 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
rc = sqlite3_blob_read(pBlob, zBuf, nByte, iOffset);
|
||||
if( rc==SQLITE_OK ){
|
||||
|
Reference in New Issue
Block a user