diff options
author | Michael Meeks <michael.meeks@novell.com> | 2010-04-23 19:34:55 +0800 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-04-23 19:34:55 +0800 |
commit | 4b4aefbddf6a5c7ae608af005dcb445820820a3c (patch) | |
tree | 50b9b87560819ce6221cbaad97e05706d8ccfe9d /calendar/gui/alarm-notify | |
parent | 0803378e3265de3a8db2d3b5c9c5108acbf563fa (diff) | |
download | gsoc2013-evolution-4b4aefbddf6a5c7ae608af005dcb445820820a3c.tar gsoc2013-evolution-4b4aefbddf6a5c7ae608af005dcb445820820a3c.tar.gz gsoc2013-evolution-4b4aefbddf6a5c7ae608af005dcb445820820a3c.tar.bz2 gsoc2013-evolution-4b4aefbddf6a5c7ae608af005dcb445820820a3c.tar.lz gsoc2013-evolution-4b4aefbddf6a5c7ae608af005dcb445820820a3c.tar.xz gsoc2013-evolution-4b4aefbddf6a5c7ae608af005dcb445820820a3c.tar.zst gsoc2013-evolution-4b4aefbddf6a5c7ae608af005dcb445820820a3c.zip |
fix dumb buffer overrun
Diffstat (limited to 'calendar/gui/alarm-notify')
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index ce76d83638..ae6eb3e172 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -192,11 +192,14 @@ e_ctime (const time_t *timep) { static char *buffer[4] = { 0, }; static int next = 0; + const char *ret; g_free (buffer[next]); - buffer[next] = g_strdup (ctime (timep)); + ret = buffer[next++] = g_strdup (ctime (timep)); + if (next >= G_N_ELEMENTS (buffer)) + next = 0; - return buffer[next++]; + return ret; } /* Queues an alarm trigger for midnight so that we can load the next day's worth |