[systemd-devel] [PATCH] bootchart: svg: fix checking of list end

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Feb 24 21:02:50 PST 2015


On Tue, Feb 24, 2015 at 06:32:31PM +0200, Aaro Koskinen wrote:
> If we have less samples than expected, systemd-bootchart will crash.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen at nokia.com>
No need for SOB.

> ---
>  src/bootchart/svg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
> index e111fa9..144177c 100644
> --- a/src/bootchart/svg.c
> +++ b/src/bootchart/svg.c
> @@ -1170,7 +1170,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;
Applied.

Zbyszek


More information about the systemd-devel mailing list