summaryrefslogtreecommitdiff
path: root/perf/cairo-perf-report.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-28 13:02:10 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-28 13:02:10 +0100
commitc11f369057c5ebb958bec58ef41f8ad4b43bdbee (patch)
tree8487460c57f924bf7a1066908e075f76a631f743 /perf/cairo-perf-report.c
parent19f44982348d247057df4481010c1e3ddc80bac2 (diff)
downloadcairo-c11f369057c5ebb958bec58ef41f8ad4b43bdbee.tar.gz
[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.
Diffstat (limited to 'perf/cairo-perf-report.c')
-rw-r--r--perf/cairo-perf-report.c8
1 files 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 ();