mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-02 05:54:29 +03:00
Fix a case where NULL was being passed to memcmp() following an OOM. This is
probably not a real problem, as the number-of-bytes parameter was passed 0 in this case, but it was causing a santizer complaint. FossilOrigin-Name: 3ea2bad27e516d5dbfa4a9cb0c767d6a8387280a7e4bbf2ae80cd318da670d66
This commit is contained in:
@@ -3731,7 +3731,6 @@ static int vdbeCompareMemString(
|
||||
}else{
|
||||
int rc;
|
||||
const void *v1, *v2;
|
||||
int n1, n2;
|
||||
Mem c1;
|
||||
Mem c2;
|
||||
sqlite3VdbeMemInit(&c1, pMem1->db, MEM_Null);
|
||||
@@ -3739,11 +3738,13 @@ static int vdbeCompareMemString(
|
||||
sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem);
|
||||
sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem);
|
||||
v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
|
||||
n1 = v1==0 ? 0 : c1.n;
|
||||
v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
|
||||
n2 = v2==0 ? 0 : c2.n;
|
||||
rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2);
|
||||
if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM_BKPT;
|
||||
if( (v1==0 || v2==0) ){
|
||||
if( prcErr ) *prcErr = SQLITE_NOMEM_BKPT;
|
||||
rc = 0;
|
||||
}else{
|
||||
rc = pColl->xCmp(pColl->pUser, c1.n, v1, c2.n, v2);
|
||||
}
|
||||
sqlite3VdbeMemRelease(&c1);
|
||||
sqlite3VdbeMemRelease(&c2);
|
||||
return rc;
|
||||
|
||||
Reference in New Issue
Block a user