1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Use 64-bit math to compute the sizes of memory allocations in extensions.

FossilOrigin-Name: ca67f2ec0e294384c397db438605df1b47aae5f348a8de94f97286997625d169
This commit is contained in:
drh
2019-01-08 20:02:48 +00:00
parent c930b405f0
commit 2d77d80a65
45 changed files with 268 additions and 273 deletions

View File

@ -42,7 +42,7 @@ static void usage(const char *argv0){
*/
static void readFile(const char *zFilename, int *pSz, void **ppBuf){
FILE *f;
int sz;
sqlite3_int64 sz;
void *pBuf;
f = fopen(zFilename, "rb");
if( f==0 ){
@ -50,9 +50,9 @@ static void readFile(const char *zFilename, int *pSz, void **ppBuf){
exit(1);
}
fseek(f, 0, SEEK_END);
sz = (int)ftell(f);
sz = ftell(f);
rewind(f);
pBuf = sqlite3_malloc( sz ? sz : 1 );
pBuf = sqlite3_malloc64( sz ? sz : 1 );
if( pBuf==0 ){
fprintf(stderr, "cannot allocate %d to hold content of \"%s\"\n",
sz, zFilename);