From c11f369057c5ebb958bec58ef41f8ad4b43bdbee Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 28 Jul 2009 13:02:10 +0100 Subject: [PATCH] [perf] Avoid NULL derefs on broken result files. Instead of testing for a NULL return we checked that the pointer didn't point to NIL. Oops. --- perf/cairo-perf-report.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c index a73538bb6..65340a1e0 100644 --- a/perf/cairo-perf-report.c +++ b/perf/cairo-perf-report.c @@ -149,17 +149,17 @@ test_report_parse (test_report_t *report, char *line, char *configuration) report->configuration = configuration; parse_string (report->backend); end = strrchr (report->backend, '.'); - if (*end) + if (end) *end++ = '\0'; - report->content = end; + report->content = end ? end : xstrdup ("???"); skip_space (); parse_string (report->name); end = strrchr (report->name, '.'); - if (*end) + if (end) *end++ = '\0'; - report->size = atoi (end); + report->size = end ? atoi (end) : 0; skip_space ();