mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Make use of the flexible-array feature of C99, when available, to try to
pacify -fsanitize=strict-bounds. This check-in fixes the core. There is more yet to do in FTS3, RTREE, and in FTS5. FossilOrigin-Name: 6fd6b32d06bd6a705e5140cd613af823b8183a6f6a9ceeeedfcf5e8b50821d68
This commit is contained in:
@@ -1039,7 +1039,8 @@ static void codeReturningTrigger(
|
||||
ExprList *pNew;
|
||||
Returning *pReturning;
|
||||
Select sSelect;
|
||||
SrcList sFrom;
|
||||
SrcList *pFrom;
|
||||
u8 fromSpace[SZ_SRCLIST_1];
|
||||
|
||||
assert( v!=0 );
|
||||
if( !pParse->bReturning ){
|
||||
@@ -1055,13 +1056,14 @@ static void codeReturningTrigger(
|
||||
return;
|
||||
}
|
||||
memset(&sSelect, 0, sizeof(sSelect));
|
||||
memset(&sFrom, 0, sizeof(sFrom));
|
||||
pFrom = (SrcList*)fromSpace;
|
||||
memset(pFrom, 0, SZ_SRCLIST_1);
|
||||
sSelect.pEList = sqlite3ExprListDup(db, pReturning->pReturnEL, 0);
|
||||
sSelect.pSrc = &sFrom;
|
||||
sFrom.nSrc = 1;
|
||||
sFrom.a[0].pSTab = pTab;
|
||||
sFrom.a[0].zName = pTab->zName; /* tag-20240424-1 */
|
||||
sFrom.a[0].iCursor = -1;
|
||||
sSelect.pSrc = pFrom;
|
||||
pFrom->nSrc = 1;
|
||||
pFrom->a[0].pSTab = pTab;
|
||||
pFrom->a[0].zName = pTab->zName; /* tag-20240424-1 */
|
||||
pFrom->a[0].iCursor = -1;
|
||||
sqlite3SelectPrep(pParse, &sSelect, 0);
|
||||
if( pParse->nErr==0 ){
|
||||
assert( db->mallocFailed==0 );
|
||||
|
Reference in New Issue
Block a user