diff options
author | unknown <tnurnberg@noir.wlan.koehntopp.de> | 2008-05-06 02:55:35 +0200 |
---|---|---|
committer | unknown <tnurnberg@noir.wlan.koehntopp.de> | 2008-05-06 02:55:35 +0200 |
commit | 55c336fd0e389d69b4c18527dff679818f8945cf (patch) | |
tree | 726d4a3603332352381310cb064a596df53465c3 /mysys/my_static.c | |
parent | ac8585e88a7fc8a0c71b1a38aabf171757a8e797 (diff) | |
download | mariadb-git-55c336fd0e389d69b4c18527dff679818f8945cf.tar.gz |
Bug#35616: memory overrun on 64-bit linux on setting large values for keybuffer-size
We could allocate chunks larger than 4GB, but did our size-accounting in 32-bit
values. This could lead to spurious warnings, inaccurate accounting, and, in
theory, data loss.
Affected: 64-bit platforms. Debug-build (with safemalloc). At least one buffer
larger than 4GB. For potential data loss, a re-alloc on such a buffer would be
necessary.
mysys/my_static.c:
Make memory-accounting 64-bit safe.
mysys/my_static.h:
Make memory-accounting 64-bit safe.
Move in struct for better alignment when 64-bit.
Diffstat (limited to 'mysys/my_static.c')
-rw-r--r-- | mysys/my_static.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys/my_static.c b/mysys/my_static.c index 77dbffb911e..1858d830f41 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -74,8 +74,8 @@ uint sf_malloc_prehunc=0, /* If you have problem with core- */ sf_malloc_endhunc=0, /* dump when malloc-message.... */ /* set theese to 64 or 128 */ sf_malloc_quick=0; /* set if no calls to sanity */ -ulong sf_malloc_cur_memory= 0L; /* Current memory usage */ -ulong sf_malloc_max_memory= 0L; /* Maximum memory usage */ +size_t sf_malloc_cur_memory= 0L; /* Current memory usage */ +size_t sf_malloc_max_memory= 0L; /* Maximum memory usage */ uint sf_malloc_count= 0; /* Number of times NEW() was called */ byte *sf_min_adress= (byte*) ~(unsigned long) 0L, *sf_max_adress= (byte*) 0L; |