From 8271bd16ce9327834d8580e55bb5e4e0896fd98a Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Wed, 18 Jun 2014 23:35:01 +0200 Subject: bootchart: add assert since 376cd3b89c62f580a6f576cecfbbb28d3944118f LIST_FIND_TAIL accepts an empty list. That removed an assert in LIST_FIND_TAIL and we now theoretically risk a null pointer deref. This adds the assert directly to protect against that. --- src/bootchart/svg.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/bootchart/svg.c') diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index 8121199529..bf6636cab1 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -80,6 +80,8 @@ static void svg_header(void) { double h; struct list_sample_data *sampledata_last; + assert(head); + sampledata = head; LIST_FIND_TAIL(link, sampledata, head); sampledata_last = head; -- cgit v1.2.3-54-g00ecf