From: Thomas Hindoe Paaboel Andersen Date: Fri, 26 Sep 2014 20:01:32 +0000 (+0200) Subject: bootchart: use 'n/a' if PRETTY_NAME is not found X-Git-Tag: v217~349 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=sidebyside;h=1c92ff85b786c423f4436ec26007e79369c9ac05;p=elogind.git bootchart: use 'n/a' if PRETTY_NAME is not found Spotted with coverity. If parsing both /etc/os-release and /usr/lib/os-release fails then null would be passed on. The calls to parse the two files are allowed to fail. A empty /etc may not have had the /etc/os-release symlink restored yet and we just try again in the loop. If for whatever reason that does not happen then we now pass on 'n/a' instead of null. --- diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 366a5ab5d..813e38dee 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -471,7 +471,7 @@ int main(int argc, char *argv[]) { exit (EXIT_FAILURE); } - svg_do(build); + svg_do(strna(build)); fprintf(stderr, "systemd-bootchart wrote %s\n", output_file);