aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/fuzzer.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-01-08 20:02:48 +0000
committerdrh <drh@noemail.net>2019-01-08 20:02:48 +0000
commit2d77d80a65a2da89d58c04f91aa282d432d5c919 (patch)
tree8a793c3cfd1f4ce2adf7df3e78be038ad48469d6 /ext/misc/fuzzer.c
parentc930b405f0717d5f8626dd846f3ab1d2a7243195 (diff)
downloadsqlite-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/fuzzer.c')
-rw-r--r--ext/misc/fuzzer.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/misc/fuzzer.c b/ext/misc/fuzzer.c
index 77db56d47..353b7ecd5 100644
--- a/ext/misc/fuzzer.c
+++ b/ext/misc/fuzzer.c
@@ -337,7 +337,7 @@ static int fuzzerLoadOneRule(
rc = SQLITE_ERROR;
}else{
- pRule = sqlite3_malloc( sizeof(*pRule) + nFrom + nTo );
+ pRule = sqlite3_malloc64( sizeof(*pRule) + nFrom + nTo );
if( pRule==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -447,11 +447,11 @@ static int fuzzerLoadRules(
** `mno` becomes mno
*/
static char *fuzzerDequote(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 ) */
@@ -513,10 +513,10 @@ static int fuzzerConnect(
);
rc = SQLITE_ERROR;
}else{
- int nModule; /* Length of zModule, in bytes */
+ sqlite3_int64 nModule; /* Length of zModule, in bytes */
- nModule = (int)strlen(zModule);
- pNew = sqlite3_malloc( sizeof(*pNew) + nModule + 1);
+ nModule = strlen(zModule);
+ pNew = sqlite3_malloc64( sizeof(*pNew) + nModule + 1);
if( pNew==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -872,7 +872,7 @@ static fuzzer_stem *fuzzerNewStem(
fuzzer_rule *pRule;
unsigned int h;
- pNew = sqlite3_malloc( sizeof(*pNew) + (int)strlen(zWord) + 1 );
+ pNew = sqlite3_malloc64( sizeof(*pNew) + strlen(zWord) + 1 );
if( pNew==0 ) return 0;
memset(pNew, 0, sizeof(*pNew));
pNew->zBasis = (char*)&pNew[1];