diff options
author | drh <drh@noemail.net> | 2019-01-08 20:02:48 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-01-08 20:02:48 +0000 |
commit | 2d77d80a65a2da89d58c04f91aa282d432d5c919 (patch) | |
tree | 8a793c3cfd1f4ce2adf7df3e78be038ad48469d6 /ext/misc/amatch.c | |
parent | c930b405f0717d5f8626dd846f3ab1d2a7243195 (diff) | |
download | sqlite-2d77d80a65a2da89d58c04f91aa282d432d5c919.tar.gz sqlite-2d77d80a65a2da89d58c04f91aa282d432d5c919.zip |
Use 64-bit math to compute the sizes of memory allocations in extensions.
FossilOrigin-Name: ca67f2ec0e294384c397db438605df1b47aae5f348a8de94f97286997625d169
Diffstat (limited to 'ext/misc/amatch.c')
-rw-r--r-- | ext/misc/amatch.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/misc/amatch.c b/ext/misc/amatch.c index 142e354f2..7d96ed500 100644 --- a/ext/misc/amatch.c +++ b/ext/misc/amatch.c @@ -619,7 +619,7 @@ static int amatchLoadOneRule( if( p->rDel==0 || p->rDel>rCost ) p->rDel = rCost; }else { - pRule = sqlite3_malloc( sizeof(*pRule) + nFrom + nTo ); + pRule = sqlite3_malloc64( sizeof(*pRule) + nFrom + nTo ); if( pRule==0 ){ rc = SQLITE_NOMEM; }else{ @@ -738,11 +738,11 @@ static int amatchLoadRules( ** `mno` becomes mno */ static char *amatchDequote(const char *zIn){ - int nIn; /* Size of input string, in bytes */ + sqlite3_int64 nIn; /* Size of input string, in bytes */ char *zOut; /* Output (dequoted) string */ - nIn = (int)strlen(zIn); - zOut = sqlite3_malloc(nIn+1); + nIn = strlen(zIn); + zOut = sqlite3_malloc64(nIn+1); if( zOut ){ char q = zIn[0]; /* Quote character (if any ) */ @@ -1069,7 +1069,7 @@ static void amatchAddWord( } return; } - pWord = sqlite3_malloc( sizeof(*pWord) + nBase + nTail - 1 ); + pWord = sqlite3_malloc64( sizeof(*pWord) + nBase + nTail - 1 ); if( pWord==0 ) return; memset(pWord, 0, sizeof(*pWord)); pWord->rCost = rCost; |