From: Thomas Hindoe Paaboel Andersen Date: Wed, 18 Jun 2014 21:35:01 +0000 (+0200) Subject: bootchart: add assert X-Git-Tag: v215~334 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=8271bd16ce9327834d8580e55bb5e4e0896fd98a 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. --- diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index 812119952..bf6636cab 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;