mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Use flexible arrays in the recovery extension and in the fuzzcheck test program.
Adjust the unix makefile to use -fsanitize=bounds-strict when building fuzzcheck-asan. FossilOrigin-Name: 6ea6a6b211fed1a14d7bec1ab1790dec09e2a00423860498a60b760c4a4561fa
This commit is contained in:
@ -140,9 +140,12 @@ struct RecoverColumn {
|
||||
typedef struct RecoverBitmap RecoverBitmap;
|
||||
struct RecoverBitmap {
|
||||
i64 nPg; /* Size of bitmap */
|
||||
u32 aElem[1]; /* Array of 32-bit bitmasks */
|
||||
u32 aElem[]; /* Array of 32-bit bitmasks */
|
||||
};
|
||||
|
||||
/* Size in bytes of a RecoverBitmap object sufficient to cover 32 pages */
|
||||
#define SZ_RECOVERBITMAP_32 (16)
|
||||
|
||||
/*
|
||||
** State variables (part of the sqlite3_recover structure) used while
|
||||
** recovering data for tables identified in the recovered schema (state
|
||||
@ -382,7 +385,7 @@ static int recoverError(
|
||||
*/
|
||||
static RecoverBitmap *recoverBitmapAlloc(sqlite3_recover *p, i64 nPg){
|
||||
int nElem = (nPg+1+31) / 32;
|
||||
int nByte = sizeof(RecoverBitmap) + nElem*sizeof(u32);
|
||||
int nByte = SZ_RECOVERBITMAP_32 + nElem*sizeof(u32);
|
||||
RecoverBitmap *pRet = (RecoverBitmap*)recoverMalloc(p, nByte);
|
||||
|
||||
if( pRet ){
|
||||
|
Reference in New Issue
Block a user