From 9d727fde463a30468d08db43da5de4e5ff26f620 Mon Sep 17 00:00:00 2001 From: Alexandru Csete Date: Sat, 28 Jan 2017 17:31:48 +0100 Subject: [PATCH] Use correct buffer size when creating time strings Fixes CID 1398137: Out-of-bounds access. --- src/gtk-polar-plot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtk-polar-plot.c b/src/gtk-polar-plot.c index 88a5212..0ab13c7 100644 --- a/src/gtk-polar-plot.c +++ b/src/gtk-polar-plot.c @@ -934,7 +934,7 @@ static GooCanvasItemModel *create_time_tick(GtkPolarPlot * pv, gdouble time, gfloat x, gfloat y) { GooCanvasItemModel *item; - gchar buff[7]; + gchar buff[6]; GtkAnchorType anchor; GooCanvasItemModel *root; guint32 col; @@ -943,7 +943,7 @@ static GooCanvasItemModel *create_time_tick(GtkPolarPlot * pv, gdouble time, col = sat_cfg_get_int(SAT_CFG_INT_POLAR_TRACK_COL); - daynum_to_str(buff, 8, "%H:%M", time); + daynum_to_str(buff, 6, "%H:%M", time); if (x > pv->cx) {