Blame SOURCES/0027-bootchart-svg-fix-checking-of-list-end.patch

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