summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_mac.cxx7
2 files changed, 6 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 8f437fb60..3cd5bab14 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
+ - Fixed uninitialized data in OS X timout function
+ (STR #1374).
- Fixed speed issues when measuring text on OS X
with Quartz (STR #1386).
- Fixed focus issues on OS X (STR #1377)
diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx
index b710deb05..9f5a1a74c 100644
--- a/src/Fl_mac.cxx
+++ b/src/Fl_mac.cxx
@@ -623,12 +623,13 @@ static void realloc_timers()
if (mac_timer_alloc == 0) {
mac_timer_alloc = 8;
}
- MacTimeout* new_timers = new MacTimeout[mac_timer_alloc * 2];
- memmove(new_timers, mac_timers, sizeof(MacTimeout) * mac_timer_used);
+ mac_timer_alloc *= 2;
+ MacTimeout* new_timers = new MacTimeout[mac_timer_alloc];
+ memset(new_timers, 0, sizeof(MacTimeout)*mac_timer_alloc);
+ memcpy(new_timers, mac_timers, sizeof(MacTimeout) * mac_timer_used);
MacTimeout* delete_me = mac_timers;
mac_timers = new_timers;
delete [] delete_me;
- mac_timer_alloc *= 2;
}
static void delete_timer(MacTimeout& t)