diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-06-18 23:35:01 +0200 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-06-19 00:18:05 +0200 |
commit | 8271bd16ce9327834d8580e55bb5e4e0896fd98a (patch) | |
tree | 478521bfc81baee476485af6c1b25f724a745a16 /src/bootchart | |
parent | a035f8191addc9422cbe84bf984adcd43134a0db (diff) |
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.
Diffstat (limited to 'src/bootchart')
-rw-r--r-- | src/bootchart/svg.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |