e4a83a8
From 668529dde3ecf35e24f39eaf3a3044099e4d5273 Mon Sep 17 00:00:00 2001
e4a83a8
From: Aaro Koskinen <aaro.koskinen@nokia.com>
e4a83a8
Date: Tue, 24 Feb 2015 18:32:31 +0200
e4a83a8
Subject: [PATCH] bootchart: svg: fix checking of list end
e4a83a8
e4a83a8
If we have less samples than expected, systemd-bootchart will crash.
e4a83a8
e4a83a8
(cherry picked from commit c1682f17a0c966988e865c649e565dae41abf32d)
e4a83a8
---
e4a83a8
 src/bootchart/svg.c | 2 +-
e4a83a8
 1 file changed, 1 insertion(+), 1 deletion(-)
e4a83a8
e4a83a8
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
e4a83a8
index e111fa9cce..144177cd47 100644
e4a83a8
--- a/src/bootchart/svg.c
e4a83a8
+++ b/src/bootchart/svg.c
e4a83a8
@@ -1170,7 +1170,7 @@ static void svg_ps_bars(void) {
e4a83a8
 
e4a83a8
                 ps->sample = ps->sample->next;
e4a83a8
                 sample_hz = ps->sample;
e4a83a8
-                for (ii=0;((ii<(int)arg_hz/2)&&(ps->sample->next));ii++)
e4a83a8
+                for (ii=0;((ii<(int)arg_hz/2)&&(sample_hz->next));ii++)
e4a83a8
                         sample_hz = sample_hz->next;
e4a83a8
 
e4a83a8
                 /* subtract bootchart cpu utilization from total */