1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Avoid using a zero-sized array within a struct in fts3 code.

FossilOrigin-Name: b05cae36cedd98d59813e637f328a52eee7ef0d2
This commit is contained in:
dan
2015-05-26 17:29:48 +00:00
parent 908aced558
commit add0804943
3 changed files with 10 additions and 10 deletions

View File

@ -104,7 +104,7 @@ struct MatchinfoBuffer {
int nElem;
int bGlobal; /* Set if global data is loaded */
char *zMatchinfo;
u32 aMatchinfo[0];
u32 aMatchinfo[1];
};
@ -130,7 +130,7 @@ struct StrBuffer {
*/
static MatchinfoBuffer *fts3MIBufferNew(int nElem, const char *zMatchinfo){
MatchinfoBuffer *pRet;
int nByte = sizeof(u32) * (2*nElem + 2) + sizeof(MatchinfoBuffer);
int nByte = sizeof(u32) * (2*nElem + 1) + sizeof(MatchinfoBuffer);
int nStr = (int)strlen(zMatchinfo);
pRet = sqlite3_malloc(nByte + nStr+1);