From: Aaro Koskinen Date: Tue, 24 Feb 2015 16:32:31 +0000 (+0200) Subject: bootchart: svg: fix checking of list end X-Git-Tag: v219.0~579 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=c1682f17a0c966988e865c649e565dae41abf32d bootchart: svg: fix checking of list end If we have less samples than expected, systemd-bootchart will crash. --- diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index 93b4764ee..e1fc531ba 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -1167,7 +1167,7 @@ static void svg_ps_bars(void) { ps->sample = ps->sample->next; sample_hz = ps->sample; - for (ii=0;((ii<(int)arg_hz/2)&&(ps->sample->next));ii++) + for (ii=0;((ii<(int)arg_hz/2)&&(sample_hz->next));ii++) sample_hz = sample_hz->next; /* subtract bootchart cpu utilization from total */