aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-04-23 19:34:55 +0800
committerMichael Meeks <michael.meeks@novell.com>2010-04-23 19:34:55 +0800
commit4b4aefbddf6a5c7ae608af005dcb445820820a3c (patch)
tree50b9b87560819ce6221cbaad97e05706d8ccfe9d /calendar/gui
parent0803378e3265de3a8db2d3b5c9c5108acbf563fa (diff)
downloadgsoc2013-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')
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c7
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